Skip to content

Instantly share code, notes, and snippets.

@OlafenwaMoses
Last active March 21, 2022 07:40
Show Gist options
  • Save OlafenwaMoses/7b9745d8111f411d15ec6372e273b205 to your computer and use it in GitHub Desktop.
Save OlafenwaMoses/7b9745d8111f411d15ec6372e273b205 to your computer and use it in GitHub Desktop.
from imageai.Classification.Custom import CustomImageClassification
import os
execution_path = os.getcwd()
prediction = CustomImageClassification()
prediction.setModelTypeAsResNet50()
prediction.setModelPath("idenprof_061-0.7933.h5")
prediction.setJsonPath("idenprof_model_class.json")
prediction.loadModel(num_objects=10)
predictions, probabilities = prediction.predictImage("image.jpg", result_count=3)
for eachPrediction, eachProbability in zip(predictions, probabilities):
print(eachPrediction , " : " , eachProbability)
@JayRathod341997
Copy link

ModuleNotFoundError: No module named 'imageai'

@sleepless-se
Copy link

sleepless-se commented Jun 11, 2019

ModuleNotFoundError: No module named 'imageai'

You need setup.
https://imageai.readthedocs.io/en/latest/

@LinuxTux193
Copy link

ModuleNotFoundError: No module named 'imageai'

pip3 install imageai

@Samyak2812
Copy link

ModuleNotFoundError: No module named 'imageai'

pip install imageai --upgrade

just run this and after that run your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment