OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.49k stars 2.18k forks source link

Close up Objects in Context not detected #21

Closed srikanthgr1 closed 6 years ago

srikanthgr1 commented 6 years ago

I tried running some tests Here is what i found I am not sure whether this is an issue to be report or not but nevertheless I am reporting it assuming this might help you

The below code was used

`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() custom_objects = detector.CustomObjects(person=True, car=True) detections = detector.detectCustomObjectsFromImage(input_image=os.path.join(execution_path , "img1.png"), output_image_path=os.path.join(execution_path , "image1_new.png"), custom_objects=custom_objects, minimum_percentage_probability=65)

for eachObject in detections: print(eachObject["name"] + " : " + eachObject["percentage_probability"] ) print("--------------------------------")`

The output was not as expected. This may be problem with resnet also.

img1 image1_new

OlafenwaMoses commented 6 years ago

The problem is that the "minimum_percentage_probability" you stated (65) is too high. Try and keep it at 50. See below the result I obtained using the same image and a "minimum_percentage_probability" of 50.

imagenew

srikanthgr1 commented 6 years ago

Thank you very much. I am learning all these concepts recently. Sorry abt the wrong questions.

OlafenwaMoses commented 6 years ago

It's okay, and you are most welcome.