Last active
September 28, 2016 14:08
-
-
Save plankes-projects/34fdcac26eee7a1a4ac4266504083724 to your computer and use it in GitHub Desktop.
How to predict one image with a model from DeepLearning4j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INDArray predict(MultiLayerNetwork model, File imageFile) throws Exception { | |
ImageLoader imageLoader = new ImageLoader(Config.IMAGE_WIDTH, Config.IMAGE_HEIGHT, Config.CHANNELS); | |
INDArray image = imageLoader.asRowVector(imageFile); | |
return model.output(image); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment