Pedestron is a MMetection based repository that focuses on the advancement of research on pedestrian detection. We provide a list of detectors, both general purpose and pedestrian specific to train and test. Moreover, we provide pre-trained models and benchmarking of several detectors on different pedestrian detection datasets. Additionally, we provide processed annotations and scripts to process the annotation of different pedestrian detection benchmarks. If you use Pedestron, please consider citing respective sources.
- [NEW] Added configurations and pre-trained model for Hybrid Task Cascade (HTC) and MobileNet
- [NEW] Evaluation code for the Caltech dataset, added to the repository
- [NEW] Ported testing of Mask-Guided Attention Network for Occluded Pedestrian Detection (MGAN). (ICCV'19), into Pedestron along with pretrained model
- [NEW] Added a pre-trained model for generic person detection
- YouTube link for qualitative results on Caltech. Pre-Trained model available.
We refer to the installation and list of dependencies to installation file. Clone this repo and follow installation.
Currently we provide configurations for with different backbones
- Cascade Mask-R-CNN
- Faster R-CNN
- RetinaNet
- Hybrid Task Cascade (HTC)
- MGAN
- We refer to Datasets preparation file for detailed instructions
Detector | Dataset | Backbone | Reasonable | Heavy |
---|---|---|---|---|
Cascade Mask R-CNN | CityPersons | HRNet | 7.5 | 28.0 |
Cascade Mask R-CNN | CityPersons | MobileNet | 10.2 | 37.3 |
Faster R-CNN | CityPersons | HRNet | 10.2 | 36.2 |
RetinaNet | CityPersons | ResNeXt | 14.6 | 39.5 |
Hybrid Task Cascade (HTC) | CityPersons | ResNeXt | 9.5 | 35.8 |
MGAN | CityPersons | VGG | 11.2 | 52.5 |
Cascade Mask R-CNN | Caltech | HRNet | 1.7 | 25.7 |
Cascade Mask R-CNN | EuroCity Persons | HRNet | 4.4 | 21.3 |
Cascade Mask R-CNN
Faster R-CNN
RetinaNet
Hybrid Task Cascade (HTC)
MGAN
- Pre-trained model can be evaluated on sample images in the following way
python tools/demo.py config checkpoint input_dir output_dir
Download one of our provided pre-trained model and place it in models_pretrained folder. Demo can be run using the following command
python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/epoch_5.pth.stu demo/ result_demo/
Train with single GPU
python tools/train.py ${CONFIG_FILE}
Train with multiple GPUs
./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]
For instance training on CityPersons using single GPU
python tools/train.py configs/elephant/cityperson/cascade_hrnet.py
Training on CityPersons using multiple(7 in this case) GPUs
./tools/dist_train.sh configs/elephant/cityperson/cascade_hrnet.py 7
Test can be run using the following command.
python ./tools/TEST_SCRIPT_TO_RUN.py PATH_TO_CONFIG_FILE ./models_pretrained/epoch_ start end\
--out Output_filename --mean_teacher
For example for CityPersons inference can be done the following way
- Download the pretrained CityPersons model and place it in the folder "models_pretrained/".
- Run the following command:
python ./tools/test_city_person.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/epoch_ 5 6\
--out result_citypersons.json --mean_teacher
or without mean_teacher flag for MGAN
python ./tools/test_city_person.py configs/elephant/cityperson/mgan_vgg.py ./models_pretrained/epoch_ 1 2\
--out result_citypersons.json
- Similarly change respective paths for EuroCity Persons
- For Caltech refer to Datasets preparation file
@article{hasan2020pedestrian,
title={Pedestrian Detection: The Elephant In The Room},
author={Hasan, Irtiza and Liao, Shengcai and Li, Jinpeng and Akram, Saad Ullah and Shao, Ling},
journal={arXiv preprint arXiv:2003.08799},
year={2020}
}