Home

Awesome

PWC

PWC

Pedestron

<img title="Amsterdam" src="gifs/1.gif" width="400" /> <img title="Amsterdam" src="gifs/2.gif" width="400"/> <img title="Amsterdam" src="gifs/3.gif" width="400"/> <img title="Amsterdam" src="gifs/4.gif" width="400"/>

Pedestron is a MMdetection 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 cite us (see at the end) and other respective sources.

:fire: News :fire:

YouTube demo

Leaderboards

Installation

We refer to the installation and list of dependencies to installation file. Clone this repo and follow installation. For setting up a Docker image, have a look at the Docker instructions. Alternatively, Google Colab step-by-step instruction can be followed for installation (Please download the pre-trained models from the table in the readme.md, the link is broken on google colab for the pre-trained model). Addiitonally, you can also refer to the google doc file for step-by-step installation. For running a docker image please see installation file. Additionally, if you have more recent versions of Cuda (such as > 11.X), please have a look at the following PR request. There are some useful tips on how to install Pedestron, feel free to contribute.

List of detectors

Currently we provide configurations for the following detectors, with different backbones

Following datasets are currently supported

Datasets Preparation

Benchmarking

Benchmarking of pre-trained models on pedestrian detection datasets (autonomous driving)

DetectorDatasetBackboneReasonableHeavy
Cascade Mask R-CNNCityPersonsHRNet7.528.0
Cascade Mask R-CNNCityPersonsMobileNet10.237.3
Faster R-CNNCityPersonsHRNet10.236.2
RetinaNetCityPersonsResNeXt14.639.5
RetinaNet with Guided AnchoringCityPersonsResNeXt11.741.5
Hybrid Task Cascade (HTC)CityPersonsResNeXt9.535.8
MGANCityPersonsVGG11.252.5
CSPCityPersonsResNet-5010.941.3
Cascade Mask R-CNNCaltechHRNet1.725.7
Cascade Mask R-CNNEuroCity PersonsHRNet4.421.3
Faster R-CNNEuroCity PersonsHRNet6.127.0

Benchmarking of pre-trained models on general human/person detection datasets

DetectorDatasetBackboneAP
Cascade Mask R-CNNCrowdHumanHRNet84.1

Getting Started

Running a demo using pre-trained model on few images

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/ 

See Google Colab demo.

Training

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  

Testing

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

  1. Download the pretrained CityPersons model and place it in the folder "models_pretrained/".
  2. 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 

Alternatively, for EuroCity Persons

python ./tools/test_euroCity.py configs/elephant/eurocity/cascade_hrnet.py ./models_pretrained/epoch_ 147 148 --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  

Testing with multiple GPUs on CrowdHuman

./tools/dist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}]
./tools/dist_test.sh configs/elephant/crowdhuman/cascade_hrnet.py ./models_pretrained/epoch_19.pth.stu 8 --out CrowdHuman12.pkl --eval bbox

Please cite the following work

CVPR2021

@InProceedings{Hasan_2021_CVPR,
    author    = {Hasan, Irtiza and Liao, Shengcai and Li, Jinpeng and Akram, Saad Ullah and Shao, Ling},
    title     = {Generalizable Pedestrian Detection: The Elephant in the Room},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {11328-11337}
}

ArXiv2022

@article{hasan2022pedestrian,
  title={Pedestrian Detection: Domain Generalization, CNNs, Transformers and Beyond},
  author={Hasan, Irtiza and Liao, Shengcai and Li, Jinpeng and Akram, Saad Ullah and Shao, Ling},
  journal={arXiv preprint arXiv:2201.03176},
  year={2022}
}