rafaelpadilla / review_object_detection_metrics

Object Detection Metrics. 14 object detection metrics: mean Average Precision (mAP), Average Recall (AR), Spatio-Temporal Tube Average Precision (STT-AP). This project supports different bounding box formats as in COCO, PASCAL, Imagenet, etc.
Other
1.09k stars 215 forks source link

Pascalvoc perfomance optimization #92

Closed Kuluum closed 2 years ago

Kuluum commented 2 years ago

Problem:

Low performance of get_pascalvoc_metrics on big (100k+ bboxes) dataset (estimation: 6 hours on my machine)

Reason:

for idx_det, det in enumerate(dects): # 100k+ iterations
    ...
    gt = [gt for gt in classes_bbs[c]['gt'] if gt.get_image_name() == img_det] # Filtering 100k+ list
    ...

A large list of gt bboxes is filtered again and again on each detection iteration.

Fix:

Create cache gt bboxes list per image name per class in advance.

Estimation 6 hours -> 6 minutes.

pytest passed.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Kuluum commented 2 years ago

@rafaelpadilla ping

rafaelpadilla commented 2 years ago

@Kuluum

I will revert the changes made in this PR due to issue #96

Could you, please, open a new PR fixing that?