msracver / Flow-Guided-Feature-Aggregation

Flow-Guided Feature Aggregation for Video Object Detection
MIT License
722 stars 192 forks source link

How to calculate AP by class? #48

Open Feywell opened 5 years ago

Feywell commented 5 years ago

I try to use do_python_eval() in lib/dataset/imagenet_vid.py to calculate mAP by classes. But I get a results like :

AP for airplane = 0.0047 AP for antelope = 0.0028 AP for bear = 0.0019 AP for bicycle = 0.0044 AP for bird = 0.0022 AP for bus = 0.0027 AP for car = 0.0021 AP for cattle = 0.0023 AP for dog = 0.0028 AP for domestic_cat = 0.0021 AP for elephant = 0.0024 AP for fox = 0.0018 AP for giant_panda = 0.0023 AP for hamster = 0.0026 AP for horse = 0.0014 AP for lion = 0.0012 AP for lizard = 0.0015 AP for monkey = 0.0023 AP for motorcycle = 0.0194 AP for rabbit = 0.0013 AP for red_panda = 0.0047 AP for sheep = 0.0009 AP for snake = 0.0013 AP for squirrel = 0.0007 AP for tiger = 0.0032 AP for train = 0.0014 AP for turtle = 0.0017 AP for watercraft = 0.0033 AP for whale = 0.0015 AP for zebra = 0.0030 Mean AP@0.5 = 0.0029

But I can get mAP = 0.7420, when i use do_python_eval_gen. What the trouble is it? How can i calculate it correctly?

Thank you!

yongfang1995 commented 5 years ago

https://sanchom.wordpress.com/tag/average-precision/ may be helpful for you

zhaowujie commented 5 years ago

I got the same problem!!
Have you solve the problem? with do_python_eval

det_file= ./output/fgfa_rfcn/imagenet_vid/resnet_v1_101_flownet_imagenet_vid_rfcn_end2end_ohem/VID_val_videos/ImageNetVID_VID_val_videos_0 Writing all ImageNetVID results file AP for airplane = 0.0051 AP for antelope = 0.0031 AP for bear = 0.0019 AP for bicycle = 0.0047 AP for bird = 0.0024 AP for bus = 0.0026 AP for car = 0.0020 AP for cattle = 0.0024 AP for dog = 0.0029 AP for domestic_cat = 0.0021 AP for elephant = 0.0023 AP for fox = 0.0019 AP for giant_panda = 0.0024 AP for hamster = 0.0026 AP for horse = 0.0015 AP for lion = 0.0009 AP for lizard = 0.0016 AP for monkey = 0.0017 AP for motorcycle = 0.0199 AP for rabbit = 0.0014 AP for red_panda = 0.0052 AP for sheep = 0.0009 AP for snake = 0.0014 AP for squirrel = 0.0008 AP for tiger = 0.0034 AP for train = 0.0014 AP for turtle = 0.0017 AP for watercraft = 0.0034 AP for whale = 0.0019 AP for zebra = 0.0031 Mean AP@0.5 = 0.0029

and with do_python_eval_gen

Writing all ImageNetVID results file

eval_vid_detection :: accumulating: motion [0.0 1.0], area [0.0 0.0 100000.0 100000.0]

eval_vid_detection :: accumulating: motion [0.0 0.7], area [0.0 0.0 100000.0 100000.0]

eval_vid_detection :: accumulating: motion [0.7 0.9], area [0.0 0.0 100000.0 100000.0]

eval_vid_detection :: accumulating: motion [0.9 1.0], area [0.0 0.0 100000.0 100000.0]

motion [0.0 1.0], area [0.0 0.0 100000.0 100000.0] Mean AP@0.5 = 0.7708

motion [0.0 0.7], area [0.0 0.0 100000.0 100000.0] Mean AP@0.5 = 0.5614

motion [0.7 0.9], area [0.0 0.0 100000.0 100000.0] Mean AP@0.5 = 0.7566

motion [0.9 1.0], area [0.0 0.0 100000.0 100000.0] Mean AP@0.5 = 0.8588

@yongfang1995 @Feywell Thanks a lot!

Sanku-Yogesh commented 2 years ago

Hi, where did u get the dataset? Could u please refer to this issue https://github.com/Scalsol/mega.pytorch/issues/73#issue-754884469