当人们站近时发现问题

我正在尝试使用Python和ImageAI- test2.png检测图像中的人数,并且正在使用以下代码:

from imageai.Detection import ObjectDetection
detector = ObjectDetection()
model_path = "yolo.h5"
input_path = 'test2.png'
output_path = "test2_new.png"
detector.setModelTypeAsYOLOv3()
detector.setModelPath(model_path)
detector.loadmodel()
custom_objects=detector.CustomObjects(person=True)
detection = detector.detectCustomObjectsFromImage(custom_objects=custom_objects,input_image=input_path,output_image_path=output_path,minimum_percentage_probability=20,display_percentage_probability=False,display_object_name=False)

for eachItem in detection:
    print(eachItem["name"]," : ",eachItem["percentage_probability"])

尽管该图像中有9个人,但是上面的代码仅标识了7个人(请参阅test2_new.png)。当人们站得很近(或一个人站在另一个人后面)时,我也会遇到类似的问题。 test2.png test2_new.png

我也尝试过使用FasterRcnn和RetinaNet解决此问题,并且得到相同的结果。

请帮助我解决此问题。 谢谢, 斯里尼

yueling195712 回答:当人们站近时发现问题

解决此问题的一种方法是使用失败的案例对模型进行重新训练,并将其添加到模型训练数据中,从而解决所有关注的案例。

本文链接:https://www.f2er.com/3123395.html

大家都在问