TsingWei / LiteTrack

A fast and high-performance visual object tracker with real-time speed on Jetson.
MIT License
41 stars 4 forks source link

LiteTrack

Official implementation of [arxiv]"LiteTrack: Layer Pruning with Asynchronous Feature Extraction for Lightweight and Efficient Visual Tracking"

TODO list:

Accuracy FPS
GOT-10k LaSOT TrackingNet 2080Ti OrinNX XavierNX OrinNX(onnx) XavierNX(onnx)
LiteTrack-B9-3 72.2 67 82.4 171 21.4 16.2 64.75 37.15
LiteTrack-B8-3 70.4 66.4 81.4 190 24.81 18.1 69.97 40.07
LiteTrack-B6-3 68.7 64.6 80.8 237 31.5 20.5 82.53 50.61
LiteTrack-B4-2 65.2 62.5 79.9 315 44.1 25.3 101.98 66.94
HiT-B 64.0 64.6 80.0 175(Not Tested)
OSTrack 71.0 69 83.1 140 17.99 12.08 50.72 30.89

Prepare Environment

Ensure that you have install the pytorch >= 1.8.1 and corresponding torchvision version. It doesn't matter whether you use pip or conda.

Then execute

bash install.sh

You can check the script where I install the opencv-python-headless library because of my headless server environment. If you are running in a machine with GUI, you can comment that out.

Set project paths

Run the following command to set paths for this project

python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output

After running this command, you can also modify paths by editing these two files

lib/train/admin/local.py  # paths about training
lib/test/evaluation/local.py  # paths about testing

Training and Evaluation on Datasets

We support training following OSTrack.

Dataset Preparation

Put the tracking datasets in ./data. It should look like this:

${PROJECT_ROOT}
 -- data
     -- lasot
         |-- airplane
         |-- basketball
         |-- bear
         ...
     -- got10k
         |-- test
         |-- train
         |-- val
     -- coco
         |-- annotations
         |-- images
     -- trackingnet
         |-- TRAIN_0
         |-- TRAIN_1
         ...
         |-- TRAIN_11
         |-- TEST

Training

Download pre-trained CAE ViT-Base weights(cae_base.pth) and put it under $PROJECT_ROOT$/pretrained_models.

NOTE: ViT in CAE is slightly different from the original ones (in Image is worth 16x16 words and MAE), e.g., projections of Q,K,V and layer scale. Details can be seen in the code.

Run the command below to train the model:

# single GPU
python tracking/train.py --script litetrack --config B8_cae_center_got10k_ep100 --save_dir ./output --mode single  --use_wandb 0

# 2 GPUs
python tracking/train.py --script litetrack --config B8_cae_center_got10k_ep100 --save_dir ./output --mode multiple --nproc_per_node 2  --use_wandb 0

Evaluation

Use your own training weights or ours(BaiduNetdisk:lite or Google Drive) in $PROJECT_ROOT$/output/checkpoints/train/litetrack.
Some testing examples: