Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion imageai_tf_deprecated/Classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ predictions, probabilities = prediction.classifyImage(image_stream, result_count
### Prediction in MultiThreading
<div id="threadprediction"></div>

When developing programs that run heavy task on the deafult thread like User Interfaces (UI),
When developing programs that run heavy task on the default thread like User Interfaces (UI),
you should consider running your predictions in a new thread. When running image prediction using ImageAI in
a new thread, you must take note the following:
- You can create your prediction object, set its model type, set model path and json path
Expand Down
12 changes: 6 additions & 6 deletions imageai_tf_deprecated/Classification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def loadModel(self, classification_speed="normal"):
try:
None
except:
raise ValueError("An error occured. Ensure your model file is a MobileNetV2 Model and is located in the path {}".format(self.modelPath))
raise ValueError("An error occurred. Ensure your model file is a MobileNetV2 Model and is located in the path {}".format(self.modelPath))

elif(self.__modelType == "resnet50"):
try:
Expand All @@ -122,7 +122,7 @@ def loadModel(self, classification_speed="normal"):
self.__model_collection.append(model)
self.__modelLoaded = True
except Exception as e:
raise ValueError("An error occured. Ensure your model file is a ResNet50 Model and is located in the path {}".format(self.modelPath))
raise ValueError("An error occurred. Ensure your model file is a ResNet50 Model and is located in the path {}".format(self.modelPath))

elif (self.__modelType == "densenet121"):
try:
Expand All @@ -131,7 +131,7 @@ def loadModel(self, classification_speed="normal"):
self.__model_collection.append(model)
self.__modelLoaded = True
except:
raise ValueError("An error occured. Ensure your model file is a DenseNet121 Model and is located in the path {}".format(self.modelPath))
raise ValueError("An error occurred. Ensure your model file is a DenseNet121 Model and is located in the path {}".format(self.modelPath))

elif (self.__modelType == "inceptionv3"):
try:
Expand All @@ -140,7 +140,7 @@ def loadModel(self, classification_speed="normal"):
self.__model_collection.append(model)
self.__modelLoaded = True
except:
raise ValueError("An error occured. Ensure your model file is in {}".format(self.modelPath))
raise ValueError("An error occurred. Ensure your model file is in {}".format(self.modelPath))


def classifyImage(self, image_input, result_count=5, input_type="file"):
Expand Down Expand Up @@ -222,12 +222,12 @@ def classifyImage(self, image_input, result_count=5, input_type="file"):
classification_results.append(str(result[1]))
classification_probabilities.append(result[2] * 100)
except:
raise ValueError("An error occured! Try again.")
raise ValueError("An error occurred! Try again.")

return classification_results, classification_probabilities


@deprecated(since="2.1.6", message="'.predictImage()' has been deprecated! Please use 'classifyImage()' instead.")
def predictImage(self, image_input, result_count=5, input_type="file"):

return self.classifyImage(image_input, result_count, input_type)
return self.classifyImage(image_input, result_count, input_type)