The code was tested on Ubuntu 18.04, with Anaconda Python 3.6 and PyTorch v1.1. NVIDIA GPUs are needed for both training and testing. 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 pytorch1.1:
pip install torch==1.1
-
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/tensorboy/centerpose $CenterNet_ROOT
-
Install the requirements
pip install -r requirements.txt
-
Compile deformable convolutional (from DCNv2).
cd $CenterNet_ROOT/src/lib/models/networks/DCNv2 ./make.sh
-
[Optional, only required if you are using extremenet or multi-scale testing] Compile NMS if your want to use multi-scale testing or test ExtremeNet.
cd $CenterNet_ROOT/src/lib/external make