duanzhiihao / RAPiD

RAPiD: Rotation-Aware People Detection in Overhead Fisheye Images (CVPR 2020 Workshops)
http://vip.bu.edu/rapid/
Other
213 stars 63 forks source link

JSON file format of coco into the JSON format used by the algorithm #45

Open wangzixiang99 opened 2 years ago

wangzixiang99 commented 2 years ago

Hello, can I have a code that converts the JSON file format of coco into the JSON format used by the algorithm? If you can, please send it to email 1195835207@qq.com , thank you very much.

Because I get the error information when I use the coco format data set for evaluation, I guess it may be because the format of the annotation file is different?

Error message:

File "/home/wang/PycharmProjects/RAPID/evaluate.py", line 57, in

eval_ custom(args.gt_path, dts_json, args.metric)

File "/home/wang/PycharmProjects/RAPID/evaluate.py", line 24, in eval_ custom

summary = valset. evaluate_ dtList(dt_json=dts_json, metric=metric)

File "/home/wang/PycharmProjects/RAPID/utils/MWtools.py", line 74, in evaluate_ dtList

self._ accumulate(**kwargs)

File "/home/wang/PycharmProjects/RAPID/utils/MWtools.py", line 208, in _ accumulate

assert ((tp_sum[:,-1] + fpsum[:,-1]) == num dt).all()

IndexError: index -1 is out of bounds for dimension 1 with size 0

duanzhiihao commented 2 years ago

One possible problem is that the COCO bounding boxes have no angle, while our evaluation code requires an angle for each bounding box. Does your COCO format dataset contain angles?

Also, if possible, please share an example of your annotation JSON file so I can locate the problem.

wangzixiang99 commented 2 years ago

Thank you for your reply.  My dataset contains angle values. I use rolabelimg to mark the pictures into XML format files, and then convert them into coco type JSON files. It can be trained normally, but the evaluation has not passed. I use the one provided by you JSON cases can be evaluated normally, but using my own JSON file will make mistakes. The only difference is the JSON format. Your JSON file is a little different from Coco's JSON file

Error message:

File "/home/wang/PycharmProjects/RAPID/evaluate.py", line 57, in

eval_ custom(args.gt_path, dts_json, args.metric)

File "/home/wang/PycharmProjects/RAPID/evaluate.py", line 24, in eval_ custom

summary = valset. evaluate_ dtList(dt_json=dts_json, metric=metric)

File "/home/wang/PycharmProjects/RAPID/utils/MWtools.py", line 74, in evaluate_ dtList

self._ accumulate(**kwargs)

File "/home/wang/PycharmProjects/RAPID/utils/MWtools.py", line 208, in _ accumulate

assert ((tp_sum[:,-1] + fpsum[:,-1]) == num dt).all()

IndexError: index -1 is out of bounds for dimension 1 with size 0

------------------ 原始邮件 ------------------ 发件人: "duanzhiihao/RAPiD" @.>; 发送时间: 2022年8月3日(星期三) 晚上11:33 @.>; @.**@.>; 主题: Re: [duanzhiihao/RAPiD] JSON file format of coco into the JSON format used by the algorithm (Issue #45)

One possible problem is that the COCO bounding boxes have no angle, while our evaluation code requires an angle for each bounding box. Does your COCO format dataset contain angles?

Also, if possible, please share an example of your annotation JSON file so I can locate the problem.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

duanzhiihao commented 2 years ago

According to the error message,

assert ((tp_sum[:,-1] + fp_sum[:,-1]) == num_ dt).all()
IndexError: index -1 is out of bounds for dimension 1 with size 0

either tp_sum or fp_sum (or maybe both) has a length of zero, meaning that no true-positive / false-positive is found.

I need a .json file containing your annotations to locate what is the difference between your annotation and ours. Otherwise I cannot proceed to answer your questions, since I do not have enough information.

wangzixiang99 commented 2 years ago

sorry, I just read the news. My JSON file can be downloaded from the following link: https://github.com/wangzixiang99/file I have tried many times and found that there is no problem using your JSON file for evaluate, but using my coco type JSON file will make an error.