Home

Awesome

Center and Scale Prediction (CSP) for pedestrian detection

Introduction

This is the unofficial pytorch implementation of High-level Semantic Feature Detection: A New Perspective for Pedestrian Detection. CSP is an effective and efficient method for pedestrian detector and achieves promising results on the CityPersons dataset. We implement CSP in pytorch based on previous works offical code (keras), unofficial code (pytorch). Compared with them, our codes have following features:

We obtain much faster training/inference speed (3 hours for 120 epoches using two gpus) and comparable performance. We think CSP is a strong baseline for pedestrian detection, and it still has much room for improvement. We will continuously update this repo, and add some useful tricks (e.g. data augmentation) for better performance.

models

ModelReasonableHeavy OcclusionAllTraining timeLink
ResNet-5011.3041.0937.55~5 hoursBaiduYun(code:v61g)
DLA-3411.1243.0037.32~3 hours
HRNet-1810.2437.7236.15~11 hours
HRNet-329.6936.4835.47~13 hours
HRNet-32 + SWA9.6634.6134.86BaiduYun(code:v61g)

Note: Training time is evaluated in two 2080Ti GPUs for 120 epochs. We will further tune some hyperparameters (e.g. learning rate, batchsize) these days, then will release our models.

Get Start

Prerequisites

Installation

git clone git@github.com:ligang-cs/CSP-Pedestrain-detection.git
cd CSP-Pedestrian-detection/utils
make all

Data preparation

You need to download the CityPersons dataset.

Your directory tree should be look like this:

$root_path/
├── images
│   ├── train
│   └── val
├── annotations
│   ├── anno_train.mat
│   └── anno_val.mat

Train and test

Please specify the configuration file.

Distributed training

CUDA_VISIBLE_DEVICES=<gpus_ids> python -m torch.distributed.launch --nproc_per_node <gpus_number> trainval_distributed.py --work-dir <save_path> 

Non-distributed training

CUDA_VISIBLE_DEVICES=<gpus_ids> python trainval.py --work-dir <save_path>

Test

CUDA_VISIBLE_DEVICES=<gpus_ids> python test.py --val-path <checkpoint_path> --json-out <results_path>

Contact

If you have any questions, please do not hesitate to contact Li Gang (gang.li@njust.edu.cn).

We also appreciate all contributions to improve this repo.

Acknowledgement

Many thanks to them !