In this project, we modify 3 representative state-of-art detectors and train them on CrowdHuman dataset. Faster R-CNN with FPN, RepPoints and Object as Points are investigated. They represent three typical new ideas in general object detection problem respectively: classical anchor-based two-stage detector with feature pyramid, deformable-based anchor free two-stage detector and anchor free one-stage detection. Our Faster R-CNN with FPN and RepPoints are implemented based on MMdetection (as shown in reference).
After install Anaconda:
-
[Optional but recommended] create a new conda environment.
conda create --name CenterNet python=3.6
And activate the environment.
conda activate CenterNet
-
Install pytorch0.4.1:
conda install pytorch torchvision -c pytorch
-
Install COCOAPI:
# COCOAPI=/path/to/clone/cocoapi git clone https://github.com/cocodataset/cocoapi.git $COCOAPI cd $COCOAPI/PythonAPI make python setup.py install --user
-
Clone this repo:
CenterNet_ROOT=/path/to/clone/CenterNet git clone https://github.com/xingyizhou/CenterNet $CenterNet_ROOT
-
Install the requirements
pip install -r requirements.txt
-
Compile and install deformable convolutional (from DCNv2).
python setup.py develop
-
Use the
./src/tools/crowd/get_crowd.sh
to download the crowd dataset and -
Place the data (or create symlinks) to make the data folder like:
${CenterNet_ROOT} |-- data `-- |-- crowd `-- |-- annotations | |-- crowd_val.json | |-- crowd_train.json `-- images |-- 273271,1a0d6000b9e1f5b7.jpg |-- ...
Analysis and download the dataset, use the file under the src\tools\crowd
, where you can find our codes for visualization anlysis, upper bound analysis, data statistics analysis, image saliency analysis.....
Use the ./experiments/train_crowd.sh
for training and testing and saliency analysis.
training setting example:
CUDA_VISIBLE_DEVICES=1,2 python src/mm_train.py ./experiments/faster_rcnn_r50_fpn.py
testing
python src/mm_test.py ./experiments/faster_rcnn_r50_fpn.py work_dirs/reppoints_moment_r50_fpn_2x/latest.pth --json_out ./results/reppoints_1333_800.json
Center Net: https://github.com/xingyizhou/CenterNet
MMdetection: https://github.com/open-mmlab/mmdetection