Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow
- from imageai.Prediction import ImagePrediction
- import os
- execution_path = os.getcwd()
- prediction = ImagePrediction()
- prediction.setModelTypeAsResNet()
- prediction.setModelPath("restnet_model.h5")
- prediction.loadModel()
- predictions, percentage_probabilities = prediction.predictImage("cars.jpg", result_count=5)
- for index in range(len(predictions)):
- print(predictions[index],":", percentage_probabilities[index])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement