Advertisement
tuomasvaltanen

Untitled

Dec 31st, 2019
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import tensorflow
  2. from imageai.Prediction import ImagePrediction
  3. import os
  4.  
  5. execution_path = os.getcwd()
  6. prediction = ImagePrediction()
  7. prediction.setModelTypeAsResNet()
  8. prediction.setModelPath("restnet_model.h5")
  9. prediction.loadModel()
  10.  
  11.  
  12. predictions, percentage_probabilities = prediction.predictImage("cars.jpg", result_count=5)
  13. for index in range(len(predictions)):
  14. print(predictions[index],":", percentage_probabilities[index])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement