CenterTrack 模型安装与demo测试

下载工程代码

git clone https://github.com/xingyizhou/CenterTrack.git

安装步骤

安装参考教程 https://github.com/xingyizhou/CenterTrack/blob/master/readme/INSTALL.md

配置conda环境,编译DCNv2时候,先设置CUDA_HOME,export CUDA_HOME=/usr/local/cuda-10.0

conda create --name CenterTrack python=3.6

conda activate CenterTrack

conda install pytorch torchvision -c pytorch

pip install cython; pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'

pip install -r requirements.txt

cd $CenterTrack_ROOT/src/lib/model/networks/
# git clone https://github.com/CharlesShang/DCNv2/ # clone if it is not automatically downloaded by `--recursive`.
cd DCNv2
./make.sh

 环境版本

(CenterTrack) cody@cody:~/PycharmProjects/CenterTrack/src/lib/model/networks/DCNv2$ conda list
# packages in environment at /home/cody/anaconda3/envs/CenterTrack:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_pytorch_select           0.2                       gpu_0  
argon2-cffi               20.1.0                    
async-generator           1.10                      
attrs                     20.2.0                    
backcall                  0.2.0                     
blas                      1.0                         mkl  
bleach                    3.2.1                     
ca-certificates           2020.10.14                    0  
cachetools                4.1.1                     
certifi                   2020.6.20                py36_0  
cffi                      1.14.3           py36he30daa8_0  
cudatoolkit               10.0.130                      0  
cudnn                     7.6.5                cuda10.0_0  
cycler                    0.10.0                    
Cython                    0.29.21                   
DCNv2                     0.1                       
decorator                 4.4.2                     
defusedxml                0.6.0                     
descartes                 1.1.0                     
easydict                  1.9                       
entrypoints               0.3                       
fire                      0.3.1                     
flake8                    3.8.4                     
flake8-import-order       0.18.1                    
freetype                  2.10.3               h5ab3b9f_0  
importlib-metadata        2.0.0                     
iniconfig                 1.1.1                     
intel-openmp              2020.2                      254  
ipykernel                 5.3.4                     
ipython                   7.16.1                    
ipython-genutils          0.2.0                     
ipywidgets                7.5.1                     
jedi                      0.17.2                    
Jinja2                    2.11.2                    
joblib                    0.17.0                    
jpeg                      9b                   h024ee3a_2  
jsonschema                3.2.0                     
jupyter                   1.0.0                     
jupyter-client            6.1.7                     
jupyter-console           6.2.0                     
jupyter-core              4.6.3                     
jupyterlab-pygments       0.1.2                     
kiwisolver                1.2.0                     
lcms2                     2.11                 h396b838_0  
ld_impl_linux-64          2.33.1               h53a641e_7  
libedit                   3.1.20191231         h14c3975_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libpng                    1.6.37               hbc83047_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.1.0                h2733197_1  
llvmlite                  0.34.0                    
lz4-c                     1.9.2                heb0550a_3  
MarkupSafe                1.1.1                     
matplotlib                3.3.2                     
mccabe                    0.6.1                     
mistune                   0.8.4                     
mkl                       2020.2                      256  
mkl-service               2.3.0            py36he904b0f_0  
mkl_fft                   1.2.0            py36h23d657b_0  
mkl_random                1.1.1            py36h0573a6f_0  
motmetrics                1.2.0                     
nbclient                  0.5.0                     
nbconvert                 6.0.7                     
nbformat                  5.0.8                     
ncurses                   6.2                  he6710b0_1  
nest-asyncio              1.4.1                     
ninja                     1.10.1           py36hfd86e86_0  
notebook                  6.1.4                     
numba                     0.51.2                    
numpy                     1.19.1           py36hbc911f0_0  
numpy-base                1.19.1           py36hfa32c7d_0  
nuscenes-devkit           1.1.0                     
olefile                   0.46                       py_0  
opencv-python             4.4.0.44                  
openssl                   1.1.1h               h7b6447c_0  
packaging                 20.4                      
pandas                    1.1.3                     
pandocfilters             1.4.2                     
parso                     0.7.1                     
pexpect                   4.8.0                     
pickleshare               0.7.5                     
pillow                    7.2.0            py36hb39fc2d_0  
pip                       20.2.3                   py36_0  
pluggy                    0.13.1                    
progress                  1.5                       
prometheus-client         0.8.0                     
prompt-toolkit            3.0.8                     
ptyprocess                0.6.0                     
py                        1.9.0                     
py-cpuinfo                7.0.0                     
pycocotools               2.0.2                     
pycodestyle               2.6.0                     
pycparser                 2.20                       py_2  
pyflakes                  2.2.0                     
Pygments                  2.7.1                     
pyparsing                 2.4.7                     
pyquaternion              0.9.9                     
pyrsistent                0.17.3                    
pytest                    6.1.1                     
pytest-benchmark          3.2.3                     
python                    3.6.12               hcff3b4d_2  
python-dateutil           2.8.1                     
pytorch                   1.3.1           cuda100py36h53c1284_0  
pytz                      2020.1                    
PyYAML                    5.3.1                     
pyzmq                     19.0.2                    
qtconsole                 4.7.7                     
QtPy                      1.9.0                     
readline                  8.0                  h7b6447c_0  
scikit-learn              0.22.2                    
scipy                     1.5.2                     
Send2Trash                1.5.0                     
setuptools                50.3.0           py36hb0f4dca_1  
Shapely                   1.7.1                     
six                       1.15.0                     py_0  
sqlite                    3.33.0               h62c20be_0  
termcolor                 1.1.0                     
terminado                 0.9.1                     
testpath                  0.4.4                     
tk                        8.6.10               hbc83047_0  
toml                      0.10.1                    
torchvision               0.4.2           cuda100py36hecfc37a_0  
tornado                   6.0.4                     
tqdm                      4.50.2                    
traitlets                 4.3.3                     
wcwidth                   0.2.5                     
webencodings              0.5.1                     
wheel                     0.35.1                     py_0  
widgetsnbextension        3.5.1                     
xmltodict                 0.12.0                    
xz                        5.2.5                h7b6447c_0  
zipp                      3.3.0                     
zlib                      1.2.11               h7b6447c_3  
zstd                      1.4.5                h9ceee32_0  

下载模型文件

下载地址:https://github.com/xingyizhou/CenterTrack/blob/master/readme/MODEL_ZOO.md

放置位置:CenterNet_ROOT/models/

测试视频位置:CenterNet_ROOT/videos/4.mp4

测试命令

python demo.py tracking --load_model ../models/coco_tracking.pth --demo /path/to/image/or/folder/or/video 

这里依然采用pycharm配置相关参数,具体详情看本系列其他文章,ID 互换的可能性比较大

CenterTrack 模型安装与demo测试_第1张图片

你可能感兴趣的:(目标跟踪,深度学习)