README.md

September 25, 2025 · View on GitHub

Data Preparation

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

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

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 .

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

Train HiT

python -m torch.distributed.launch --nproc_per_node 8 lib/train/run_training.py --script HiT --config HiT_Base --save_dir .

(Optionally) Debugging training with a single GPU

python lib/train/run_training.py --script HiT --config HiT_Base --save_dir .

Train DyHiT

Before training DyHiT, you need to download the HiT_Base weights and modify the WEIGHT path in experiments/DyHiT/stage1.yaml to point to the location of the HiT_Base weights.

python lib/train/run_training.py --script DyHiT --config stage1 --save_dir .

After completing the first stage of training, you need to modify the WEIGHT path in experiments/DyHiT/stage2.yaml to the weights obtained from the first stage.

python lib/train/run_training.py --script DyHiT --config stage2 --save_dir .

Test and evaluate on benchmark

When evaluating DyHiT, you can adjust the THRESHOLD parameter (range 0.6–1) in experiments/DyHiT/stage2.yaml to achieve different speed–accuracy trade-offs.

  • LaSOT
python tracking/test.py HiT HiT_Base --dataset lasot --threads 2 --num_gpus 2 --debug 0
python tracking/analysis_results.py # need to modify tracker configs and names
  • GOT10K-test
python tracking/test.py HiT HiT_Base --dataset got10k_test --threads 2 --num_gpus 2 --debug 0
python lib/test/utils/transform_got10k.py --tracker_name HiT --cfg_name HiT_Base
  • TrackingNet
python tracking/test.py HiT HiT_Base --dataset trackingnet --threads 2 --num_gpus 2 --debug 0
python lib/test/utils/transform_trackingnet.py --tracker_name HiT --cfg_name HiT_Base
  • NFS
python tracking/test.py HiT HiT_Base --dataset nfs --threads 2 --num_gpus 2 --debug 0
python tracking/analysis_results.py # need to modify tracker configs and names
  • UAV123
python tracking/test.py HiT HiT_Base --dataset uav --threads 2 --num_gpus 2 --debug 0
python tracking/analysis_results.py # need to modify tracker configs and names
  • LaSOText
python tracking/test.py HiT HiT_Base --dataset lasot_extension_subset --threads 2 --num_gpus 2 --debug 0
python tracking/analysis_results.py # need to modify tracker configs and names

Accelerating the Base Tracker

We demonstrate how to use DyHiT to accelerate OSTrack (DyOSTrack). You can refer to this approach to accelerate other base trackers as well.

python tracking/test.py DyOSTrack dyostrack --dataset <dataset_name> --threads 2 --num_gpus 2 --debug 0

Run Video demo

python tracking/video_demo.py <path of onnx model> <video path> 

Transform onnx; test speed, flops, params

python tracking/transfer_onnx
python tracking/profile_model_hit --script HiT --config HiT_Base
python tracking/profile_model_hit_cpu --script HiT --config HiT_Base 
python tracking/profile_model_hit_onnx --script HiT --config HiT_Base
python tracking/profile_model_hit_onnx_cpu --script HiT --config HiT_Base
python tracking/profile_model_dyhit_route1.py # test speed for dyhit only use route1

Models && Raw results

The trained models, and the raw tracking results are provided in here

Acknowledgement

  • This codebase is implemented on STARK and PyTracking.We would like to thank their authors for providing great libraries.

Contact