Last active
January 5, 2021 14:53
-
-
Save OlafenwaMoses/60a0091fdefe48113d862fc5696f4e3b to your computer and use it in GitHub Desktop.
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
from imageai.Classification import ImageClassification | |
import os | |
execution_path = os.getcwd() | |
prediction = ImageClassification() | |
prediction.setModelTypeAsResNet50() | |
prediction.setModelPath( execution_path + "\resnet50_imagenet_tf.2.0.h5") | |
prediction.loadModel() | |
predictions, percentage_probabilities = prediction.classifyImage("C:\Users\MyUser\Downloads\sample.jpg", result_count=5) | |
for index in range(len(predictions)): | |
print(predictions[index] , " : " , percentage_probabilities[index]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment