参考:
https://blog.csdn.net/laizi_laizi/article/details/110444884
本文路径说明:
- 本文pytracking的代码路径为:/home/zjj/workspace/pytracking_project_0/pytracking
- 本文conda下pytracking环境的路径为:/home/zjj/miniconda3/envs/pytracking
- 本文conda下VOT环境的路径为:/home/zjj/miniconda3/envs/vot2020
- 本文workspace工作区( 保存日志文件和报错记录的路径 )设置为:~/workspace/vot-toolkit/vot2020
一、安装
- 安装VOT环境
conda create -n vot2020 python=3.7
conda activate vot2020
pip install git+https://github.com/votchallenge/vot-toolkit-python
- 在pytacking环境中安装
pip install vot-trax>=3.0.2
二、初始化
1、初始化工作区
- 如果已有数据集的话
# 指定工作区路径
vot initialize vot2020 --workspace ~/workspace/vot-toolkit/vot2020 --nodownload
# /home/zjj/miniconda3/envs/vot2020/lib/python3.7/site-packages/vot/stack
# 手动软连接vot2020数据集路径
cd ~/workspace/vot-toolkit/vot2020
mv sequences sequences_old
ln -s /home/zjj/Videos/VOT2020 /home/zjj/workspace/vot-toolkit/vot2020/sequences
- 注意,新版的VOT数据集中新增了一个sequence文件,如果仍使用旧版本数据集+新版本的VOT-TOOLKIT会报错:
vot.dataset.DatasetException: Empty sequence, no frames found.
这时不建议安装旧版本的VOT-TOOLKIT,而是建议重新下载数据集,因为支持新版。 - 如果没有数据集的话
# 指定工作区路径
vot initialize vot2020 --workspace ~/workspace/vot-toolkit/vot2020
2、修改trackers.ini
- 打开 workspace路径下的trackers.ini(~/workspace/vot-toolkit/vot2020/trackers.ini)
- 修改"path"为pytracking的代码路径,"python"为conda下pytracking环境的路径中python解释器的路径
[DiMP]
label = DiMP
protocol = traxpython
command = import pytracking.run_vot as run_vot; run_vot.run_vot2020('dimp', 'dimp50')
# 注意,无论是跑vot2020还是vot2019,都需要写run_vot2020,而不是往年的run_vot,run_vot2020中也集成了矩形框的借口
paths = /home/zjj/workspace/pytracking_project_0/pytracking/pytracking
python = /home/zjj/miniconda3/envs/pytracking/bin/python
3、修改VOT.py
- 用pytracking代码路径下VOT/vot.py替换掉evaluation/vot.py
cd /home/zjj/workspace/pytracking_project_0/pytracking
mv evaluation/vot.py evaluation/vot_old.py
mv VOT/vot.py evaluation/vot.py
三、运行测试
conda activate vot2020
vot evaluate --workspace /home/zjj/workspace/vot-toolkit/vot2020 DiMP
vot analysis --workspace /home/zjj/workspace/vot-toolkit/vot2020 DiMP