Official implementation of the TransT (CVPR2021) , including training code and trained models.
Model | LaSOT AUC (%) |
TrackingNet AUC (%) |
GOT-10k AO (%) |
Speed |
Params |
---|---|---|---|---|---|
TransT-N2 | |||||
TransT-N4 | 64.9 | 81.35 | 72.3 | 47fps | 23M |
TransT-N6 |
This document contains detailed instructions for installing the necessary dependencied for TransT. The instructions have been tested on Ubuntu 18.04 system.
-
Create and activate a conda environment
conda create -n transt python=3.7 conda activate transt
-
Install PyTorch
conda install -c pytorch pytorch=1.5 torchvision=0.6.1 cudatoolkit=10.2
-
Install other packages
conda install matplotlib pandas tqdm pip install opencv-python tb-nightly visdom scikit-image tikzplotlib gdown conda install cython scipy pip install pycocotools jpeg4py pip install wget yacs pip install shapely==1.6.4.post2
-
Setup the environment
Create the default environment setting files.# Change directory to <PATH_of_TransT> cd TransT # Environment settings for pytracking. Saved at pytracking/evaluation/local.py python -c "from pytracking.evaluation.environment import create_default_local_file; create_default_local_file()" # Environment settings for ltr. Saved at ltr/admin/local.py python -c "from ltr.admin.environment import create_default_local_file; create_default_local_file()"
You can modify these files to set the paths to datasets, results paths etc.
- Add the project path to environment variables
Open ~/.bashrc, and add the following line to the end. Note to change <path_of_TransT> to your real path.export PYTHONPATH=<path_of_TransT>:$PYTHONPATH
- Download the pre-trained networks
Download the network for TransT and put it in the directory set by "network_path" in "pytracking/evaluation/local.py". By default, it is set to pytracking/networks.
- Modify local.py to set the paths to datasets, results paths etc.
- Runing the following commands to train the TransT. You can customize some parameters by modifying transt.py
conda activate transt cd TransT/ltr python run_training.py transt transt
-
We integrated GOT-10k Python Toolkit to eval on GOT-10k, OTB (2013/2015), VOT (2013~2018), DTB70, TColor128, NfS (30/240 fps), UAV (123/20L), LaSOT and TrackingNet benchmarks. Please refer to got10k_toolkit for details. For convenience, We provide some python files to test and eval on the corresponding benchmarks. For example test_got.py and evaluate_got.py.
You need to specify the path of the model and dataset in the these files.
net_path = '/path_to_model' #Absolute path of the model dataset_root= '/path_to_datasets' #Absolute path of the datasets
Then run the following commands.
conda activate TransT cd TransT python got10k_toolkit/toolkit/test_got.py #test tracker python got10k_toolkit/toolkit/evaluate_got.py #eval tracker
-
We also integrated PySOT, You can use it to eval on VOT2019.
You need to specify the path of the model and dataset in the test.py.
net_path = '/path_to_model' #Absolute path of the model dataset_root= '/path_to_datasets' #Absolute path of the datasets
Then run the following commands.
conda activate TransT cd TransT python -u pysot_toolkit/test.py --dataset VOT2019 #test tracker #test tracker python pysot_toolkit/eval.py --tracker_path pysot_toolkit/results/ --dataset VOT2019 --num 1 #eval tracker
-
You can also use pytracking to test and evaluate tracker. But we have not carefully tested it, the results might be slightly different with the two methods above due to the slight difference in implementation (pytracking saves results as integers, got-10k toolkit saves the results as decimals).
This is a modified version of the python framework PyTracking based on Pytorch, also borrowing from PySOT and GOT-10k Python Toolkit. We would like to thank their authors for providing great frameworks and toolkits.
- Xin Chen (email:chenxin3131@mail.dlut.edu.cn)