hasanirtiza / Pedestron

[Pedestron] Generalizable Pedestrian Detection: The Elephant In The Room. @ CVPR2021
https://openaccess.thecvf.com/content/CVPR2021/papers/Hasan_Generalizable_Pedestrian_Detection_The_Elephant_in_the_Room_CVPR_2021_paper.pdf
Apache License 2.0
687 stars 159 forks source link

Testing a CP trained model on ECP val dataset #171

Closed Git-Frk closed 5 months ago

Git-Frk commented 5 months ago

Hi, I trained the Cascade Mask R-CNN on CityPersons dataset and when attempting to test the model on the EuroCity Persons validation dataset, I encountered the following error:

Screenshot 2024-04-29 at 18 09 12

Error: raise IOError('{} is not a directory and not a dataset file.'.format(gt_path)) OSError: ./datasets/EuroCity/ECP/day/labels/val is not a directory and not a dataset file.

To address this error, I created the directory as indicated in the error message and moved day_val.json into it. However, this led to another error:

Screenshot 2024-04-29 at 18 12 40

Error: ValueError: Number of detection json files 4266 does not match the number of ground truth json files 1. Please provide for each image in the ground truth set one detection file.

Should I use the official annotation files for the ECP dataset?

Could you please assist me in resolving this issue? I've checked the closed issues, but it doesn't seem like anyone has raised a similar problem yet.

Thank you for your help

hasanirtiza commented 5 months ago

@Git-Frk I have some recollection of facing this issue. Most probably, it is not related to creating a path, but rather missing annotations file, so yes, I would suggest downloading the whole dataset from official source, if you look at the official github repo of ecp, there is path and probably there are some json files over there that you need to add in Pedestron.

Git-Frk commented 5 months ago

@hasanirtiza Thank you for the reply! I will try it and post here how it goes.

Git-Frk commented 5 months ago

@hasanirtiza Hi, it worked, thanks! For anyone who wants to do the same, you might encounter this error when attempting to evaluate on the ECP validation dataset:

AttributeError: module 'statistics' has no attribute 'MrFppi'

This error is caused by a helper script named 'statistics.py' saved in Pedestron/tools/ECPB, which is used by the script eval.py in the same location. The error arises due to a naming conflict with Python's built-in 'statistics' module. To resolve it, simply rename the file -'statistics.py' to something like 'stats.py' and adjust the import statement in eval.py to from .stats import MrFppi. That should fix the issue.