Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Performance Metrics are 0 #36

Open
ozanpkr opened this issue Sep 7, 2021 · 2 comments
Open

All Performance Metrics are 0 #36

ozanpkr opened this issue Sep 7, 2021 · 2 comments

Comments

@ozanpkr
Copy link

ozanpkr commented Sep 7, 2021

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] =??

@ZFTurbo
Copy link
Owner

ZFTurbo commented Sep 7, 2021

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.

@ozanpkr
Copy link
Author

ozanpkr commented Sep 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants