0

I did training and validation as like in keras documentation. But how to test the images. I know how to do it in scikit-learn. But I want to do in keras.

Let's say I want to predict the image which is in form of categorical class. And at the final I also want to print the class name, training accuracy, testing accuracy and finally the predicted image accuracy (Eg. Dog : 99.8 %).

CodeRed
  • 81
  • 6

1 Answers1

0

To make predictions from a trained model you just have to use the predict function:

model.predict([image])[0]

Where image is a image sample of the appropriate shape. The result value is what is output by the model, typically softmax probabilities if you have a typical classification model.

Dr. Snoopy
  • 55,122
  • 7
  • 121
  • 140
  • How to separate the data like x_test and y_test in keras ? – CodeRed Mar 17 '18 at 08:06
  • @CodeRed Comments are only for clarifications about the answer, not to ask additional unrelated questions. For that you need to make a new question, but I am pretty sure that has already been answered here, so you need to search. – Dr. Snoopy Mar 17 '18 at 08:13