Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lukasjapan/185d474e4b684e411c8141801a5fdfc1 to your computer and use it in GitHub Desktop.
Save lukasjapan/185d474e4b684e411c8141801a5fdfc1 to your computer and use it in GitHub Desktop.
using-deeplearning4j-to-distinguish-between-cats-and-dogs 1
val model = VGG16().initPretrained(PretrainedType.IMAGENET) as ComputationGraph
val image = FileInputStream("input.png")
val input = NativeImageLoader(224, 224, 3).asMatrix(image).also { VGG16ImagePreProcessor().transform(it) }
val output = model.outputSingle(input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment