Last active
August 30, 2019 14:39
-
-
Save OlafenwaMoses/175c4c5b47e3fe8fbb91038b6f026c8a 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.Detection.Custom import CustomObjectDetection | |
import os | |
execution_path = os.getcwd() | |
detector = CustomObjectDetection() | |
detector.setModelTypeAsYOLOv3() | |
detector.setModelPath(detection_model_path="detection_model-ex-028--loss-8.723.h5") | |
detector.setJsonPath(configuration_json="detection_config.json") | |
detector.loadModel() | |
detections = detector.detectObjectsFromImage(input_image="image.jpg", minimum_percentage_probability=60, output_image_path="image-new.jpg") | |
for detection in detections: | |
print(detection["name"], " : ", detection["percentage_probability"], " : ", detection["box_points"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment