vita-epfl / butterflydetector

Other
9 stars 1 forks source link

calculating mAP of trained model #1

Open toddChavezz opened 4 years ago

toddChavezz commented 4 years ago

How does one calculate the mAP of a trained model? The intended way to do so appears to be with benchmark.py which then calls eval.py. But it appears to me that when running this, stats from line 107 in benchmark.py will always be empty, because eval.py never writes any file of the form *.stats.json which is looked for in the generation of the variable stats.
The line which might be intended to write the stats to disk in the needed form is line 308 from eval.py as it uses an InstanceScoreRecorder object. But this line is a comment and even if it wasn't, it's output is not of the form *.stats.json but it merely writes to ./instance_score_data.json. Am I missing something?
Thank you a lot in advance!

george-adaimi commented 3 years ago

Hello,

Sorry for the late reply. I just added an evaluation section which should help. The benchmark.py file is a remanent from another project. Since the official VisDrone and UAVDT authors provide a matlab evaluator, our eval.py script writes the prediction in the format required by these evaluators. To obtain the mAP, simply feed the directory where the predictions are save to the dataset's respective evaluator.

Hope this helps!