NEW: now including code for both training and inference!
This is the official implementation with training code for SiamMask (CVPR2019). For technical details, please refer to:
Fast Online Object Tracking and Segmentation: A Unifying Approach
Qiang Wang*, Li Zhang*, Luca Bertinetto*, Weiming Hu, Philip H.S. Torr (* denotes equal contribution)
CVPR 2019
[Paper] [Video] [Project Page]
If you find this code useful, please consider citing:
@inproceedings{wang2019fast,
title={Fast online object tracking and segmentation: A unifying approach},
author={Wang, Qiang and Zhang, Li and Bertinetto, Luca and Hu, Weiming and Torr, Philip HS},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
year={2019}
}
This code has been tested on Ubuntu 16.04, Python 3.6, Pytorch 0.4.1, CUDA 9.2, RTX 2080 GPUs
git clone https://github.com/foolwood/SiamMask.git && cd SiamMask
export SiamMask=$PWD
conda create -n siammask python=3.6
source activate siammask
pip install -r requirements.txt
bash make.sh
export PYTHONPATH=$PWD:$PYTHONPATH
cd $SiamMask/experiments/siammask_sharp
wget http://www.robots.ox.ac.uk/~qwang/SiamMask_VOT.pth
wget http://www.robots.ox.ac.uk/~qwang/SiamMask_DAVIS.pth
demo.py
cd $SiamMask/experiments/siammask_sharp
export PYTHONPATH=$PWD:$PYTHONPATH
python ../../tools/demo.py --resume SiamMask_DAVIS.pth --config config_davis.json
cd $SiamMask/data
sudo apt-get install jq
bash get_test_data.sh
cd $SiamMask/experiments/siammask_sharp
wget http://www.robots.ox.ac.uk/~qwang/SiamMask_VOT.pth
wget http://www.robots.ox.ac.uk/~qwang/SiamMask_VOT_LD.pth
wget http://www.robots.ox.ac.uk/~qwang/SiamMask_DAVIS.pth
bash test_mask_refine.sh config_vot.json SiamMask_VOT.pth VOT2016 0
bash test_mask_refine.sh config_vot.json SiamMask_VOT.pth VOT2018 0
bash test_mask_refine.sh config_vot.json SiamMask_VOT.pth VOT2019 0
bash test_mask_refine.sh config_vot18.json SiamMask_VOT_LD.pth VOT2016 0
bash test_mask_refine.sh config_vot18.json SiamMask_VOT_LD.pth VOT2018 0
python ../../tools/eval.py --dataset VOT2016 --tracker_prefix C --result_dir ./test/VOT2016
python ../../tools/eval.py --dataset VOT2018 --tracker_prefix C --result_dir ./test/VOT2018
python ../../tools/eval.py --dataset VOT2019 --tracker_prefix C --result_dir ./test/VOT2019
bash test_mask_refine.sh config_davis.json SiamMask_DAVIS.pth DAVIS2016 0
bash test_mask_refine.sh config_davis.json SiamMask_DAVIS.pth DAVIS2017 0
bash test_mask_refine.sh config_davis.json SiamMask_DAVIS.pth ytb_vos 0
These are the reproduction results from this repository. All results can be downloaded from our project page.
Tracker | VOT2016EAO / A / R | VOT2018EAO / A / R | DAVIS2016J / F | DAVIS2017J / F | Youtube-VOSJ_s / J_u / F_s / F_u | Speed |
---|---|---|---|---|---|---|
SiamMask-box | 0.412/0.623/0.233 | 0.363/0.584/0.300 | - / - | - / - | - / - / - / - | 77 FPS |
SiamMask | 0.433/0.639/0.214 | 0.380/0.609/0.276 | 0.713/0.674 | 0.543/0.585 | 0.602/0.451/0.582/0.477 | 56 FPS |
SiamMask-LD | 0.455/0.634/0.219 | 0.423/0.615/0.248 | - / - | - / - | - / - / - / - | 56 FPS |
Note:
-box
reports an axis-aligned bounding box from the box branch.-LD
means training with large dataset (ytb-bb+ytb-vos+vid+coco+det).(This model was trained on the ImageNet-1k Dataset)
cd $SiamMask/experiments
wget http://www.robots.ox.ac.uk/~qwang/resnet.model
ls | grep siam | xargs -I {} cp resnet.model {}
cd $SiamMask/experiments/siammask_base/
bash run.sh
run.sh
.bash test_all.sh -s 1 -e 20 -d VOT2018 -g 4 # test all snapshots with 4 GPUs
#bash test_all.sh -m [best_test_model] -d VOT2018 -n [thread_num] -g [gpu_num] # 8 threads with 4 GPUS
bash test_all.sh -m snapshot/checkpoint_e12.pth -d VOT2018 -n 8 -g 4 # 8 threads with 4 GPUS
cd $SiamMask/experiments/siammask_sharp
bash run.sh <best_base_model>
bash run.sh checkpoint_e12.pth
bash test_all.sh -s 1 -e 20 -d VOT2018 -g 4
cd $SiamMask/experiments/siamrpn_resnet
bash run.sh
bash test_all.sh -h
bash test_all.sh -s 1 -e 20 -d VOT2018 -g 4
Licensed under an MIT license.