Skip to content

Instantly share code, notes, and snippets.

View Shohjahon's full-sized avatar

Shoh Jahon Shohjahon

  • Technologic ASBT
  • Republic of Uzbekistan, Fergana Region, Buvayda District, Yangikuragan , St Gofur Gulom 44.
View GitHub Profile
detections, extracted_images = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "image.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg"), extract_detected_objects=True)
for eachObject in detections:
print(eachObject["name"] , " : " , eachObject["percentage_probability"] )
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 , "image.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg"))
from imageai.Detection import ObjectDetection
import os
execution_path = os.getcwd()
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 , "image.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg"))