aliborji / DetectionUpperbound

Code for calculating the upper bound AP in object detection
81 stars 4 forks source link

Where can I get the json files? #4

Open liliangqi opened 4 years ago

liliangqi commented 4 years ago

There are several json files such as Mask_LOC_IMG.json, coco_GT.json mentioned in Error_diagnosis.ipynb, so I'd like to know how to generate such json files? Thanks.

miranmanesh commented 4 years ago

The only file that you need is the .json file which is the output of your detection model and the ground truth. Then you convert it to dictionary based on the images as keys using this:

GT_table = {} for img in data_valid['images']: img_bboxes = [] for bboxes in data_valid['annotations']: if (bboxes['image_id']==img['id']): img_bboxes.append(bboxes) GT_table[img['id']]=img_bboxes

So basically "coco_GT.json" is the ground truth of coco after converting to the image based dictionary using the above code. You need this for speeding in the loop calls. Then you create each file step by step based on the code and explanation in the paper. For example, the "Mask_Ioc_IMG.json" is the output of the "mask-rcnn" detection after applying the localization step.