Weighted-Boxes-Fusion icon indicating copy to clipboard operation
Weighted-Boxes-Fusion copied to clipboard

All Performance Metrics are 0

Open ozanpkr opened this issue 4 years ago • 2 comments

I wanna use this repo with mmdetection result.I edited Json and converted to CSV format.However I get 0 for mAP and Recall. I can share my csv and ground_truth.json files via drive link.In addition you can see my detection output for model_1 below; out_det

You can see json2csv script on below;

with open('fsaf_r50.csv', 'w', encoding='UTF8',newline='') as ff:
    writer = csv.writer(ff)
    writer.writerow(header)
    for i in range(0,len(data)):

            real_data=data[i]['bbox']

            
            real_data[2]=real_data[0]+real_data[2]
            real_data[3]=real_data[1]+real_data[3]

            normalized_arr = preprocessing.normalize([real_data])
            
            image_id=data[i]['image_id'][:]
            csv_data = [int(image_id), normalized_arr[0][0],normalized_arr[0][1],normalized_arr[0][2],normalized_arr[0][3], data[i]['score'],data[i]['category_id'],]
            writer.writerow(csv_data)

I think normalization process is wrong my code or ground_truth.json configuration is false.Could you help me ? You can access all code with this URL:

https://github.com/ozanpkr/Weighted-Boxes-Fusion/tree/master/ozan

Could you normalize this bbox? format=[x1,y1,width,height] !!!(x1,y1) refer to upper left [148,186,72,96] =??

ozanpkr avatar Sep 07 '21 08:09 ozanpkr

You need to convert boxes in x1, y1, x2, y2 format, then normalize (using image width and height).

xn1 = x1 / image_width
yn1 = y1 / image_height
xn2 = (x1 + width) / image_width
yn2 = (y1 + height) / image_height

then you can apply WBF.

ZFTurbo avatar Sep 07 '21 10:09 ZFTurbo

You need to convert boxes in x1, y1, x2, y2 format, then normalize (using image width and height).

xn1 = x1 / image_width
yn1 = y1 / image_height
xn2 = (x1 + width) / image_width
yn2 = (y1 + height) / image_height

then you can apply WBF.

Thanx for quick reply :) I'll let you know about results

ozanpkr avatar Sep 07 '21 10:09 ozanpkr