Train
January 3, 2020 ยท View on GitHub
This is a generic framework for siamese tracking. Follow the instructions to embed your ideas to this code easily.
Data preparation
- We provide pre-processed
VID,YTB,GOT10K,COCO,DETandLASOT. You can download it from GoogleDrive or BaiduDrive. - BaiduDrive extracted code
bnd9 - Some data can only be downloaded from GoogleDrive since uploading size limitation of BaiduDrive.
Pretrained model preparation
Our code will download pretrained model from GoogleDrive automatically. If failed, please download from OneDrive, GoogleDrive or BaiduDrive, and put them to pretrain directory.
Conda preparation
sh install_fc.sh or sh install_rpn.sh
Toolkit preparation
Modify path_to/toolkit in lib/core/get_eao.m to your vot-toolkit path.
Setting preparation
Modify yaml files in experiment/train/ according to your needs.
One-key Running
This script will excute train-epoch-test-hyper-parameter tuning automatically to save your time.
python siamese_tracking/onekey_fc.py
or
python siamese_tracking/onekey.py
Watch tuning process
The tuning toolkit will not stop unless you do. So we provide scripts to watch its process. 600-1000 groups and 1000-3000 groups for SiamFC and SiamRPN respectively is a good choice from my experience.
sh lib/utils/watch_tpe.sh or sh lib/utils/watch_tpe_fc.sh
Implement your ideas on our code
Data optimization
- We provide a demo to generate training pairs. You can modify it to process any data you want.
- Different training data and mix-up ratio will affect final performance. You can modify
WITCH_USEin yaml files ofexperiment/train/to find witch data is better for your task. Also, modifyUSEin yaml files to try different mix-up ratio. High quality training data is beneficial to training.GOT10KandLASOTare recommended.
Backbone optimization
We provide ResNet, Inception and ResNext in codes. However, there are many other choices like DenseNet, NasNet. I got an email from a reader who said that DenseNet can get better results in my framework.
Add your backbone in lib/models/backbone.py. Pretraining backbone on Imagenet is always good to training.
Cross-correlation optimization
Cross-correlation is the key operation in both SiamFC and SiamRPN. There may be optima way to replace it. For example, cosine distance and normalized L2 distance is better for SiamFC from my experience.
Add your strategy in lib/models/connect.py.
Loss optimization
We use the simplest loss function in training. You can try more optimal loss function like focal loss.
Add your loss function in lib/models/siamfc.py or lib/models/siamrpn.py
:hammer: Tips
- If you want to train Res16 or Res19, pls modify
self.features = ResNet(Bottleneck_CI, [3, 4], [True, False], [False, True])inbackbone.pytoself.features = ResNet(Bottleneck_CI, [3, 2], [True, False], [False, True])for 16 orself.features = ResNet(Bottleneck_CI, [3, 3], [True, False], [False, True])for 19.
===============================================================================
Further discussion or questions about code please email zhangzhipeng2017@ia.ac.cn.
Let's learn to progress together.