from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(
    input_image=os.path.join(execution_path , "image4.jpeg"),
    output_image_path=os.path.join(execution_path , "imagenew4.jpg"),
)
for eachObject in detections:
    print(eachObject["name"] + " : " + eachObject["percentage_probability"])

99d2ea4345aab327ed294961bd2c962652f847e3
<mask token>

<mask token>
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(execution_path,
    'resnet50_coco_best_v2.0.1.h5'))
detector.loadModel()
<mask token>
for eachObject in detections:
    print(eachObject['name'] + ' : ' + eachObject['percentage_probability'])

<mask token>
execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(execution_path,
    'resnet50_coco_best_v2.0.1.h5'))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(
    execution_path, 'image4.jpeg'), output_image_path=os.path.join(
    execution_path, 'imagenew4.jpg'))
for eachObject in detections:
    print(eachObject['name'] + ' : ' + eachObject['percentage_probability'])

from imageai.Detection import ObjectDetection
import os
execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(execution_path,
    'resnet50_coco_best_v2.0.1.h5'))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(
    execution_path, 'image4.jpeg'), output_image_path=os.path.join(
    execution_path, 'imagenew4.jpg'))
for eachObject in detections:
    print(eachObject['name'] + ' : ' + eachObject['percentage_probability'])

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(
    input_image=os.path.join(execution_path , "image4.jpeg"),
    output_image_path=os.path.join(execution_path , "imagenew4.jpg"),
)
for eachObject in detections:
    print(eachObject["name"] + " : " + eachObject["percentage_probability"])
