Created
August 1, 2019 13:40
-
-
Save OlafenwaMoses/d399e61386fc4adb4e67e834cde50c00 to your computer and use it in GitHub Desktop.
Code for detection Hololens in pictures using a trained custom model
This file contains hidden or 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 | |
detector = CustomObjectDetection() | |
detector.setModelTypeAsYOLOv3() | |
detector.setModelPath("hololens-ex-60--loss-2.76.h5") | |
detector.setJsonPath("detection_config.json") | |
detector.loadModel() | |
detections = detector.detectObjectsFromImage(input_image="holo3.jpg", output_image_path="holo3-detected.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