Language: English | 简体中文
This repo is the unofficial implementation of the following Mamba-based Multi-object trackers: (This two papers have not released the official code yet)
-
MambaTrack: A Simple Baseline for Multiple Object Tracking with State Space Model ACM MM'25
-
TrackSSM: A General Motion Predictor by State-Space Model arXiv:2409.00487
- [] Add model of paper: Exploring Learning-based Motion Models inMulti-Object Tracking arXiv:2403.10826
- Supporting dataset: DanceTrack, MOT17 and VisDrone2019
Demo result of DanceTrack-val:
MambaTrack:
TrackSSM:
- Results of DacneTrack-val and checkpoints:
| Models | HOTA | MOTA | IDF1 | checkpoint |
|---|---|---|---|---|
| MambaTrack | 32.672 | 78.392 | 26.419 | Baidu Disk, code: e0mv |
| TrackSSM | 27.536 | 72.366 | 20.756 | Baidu Disk, code: 2797 |
I'm trying to achieve better results
For training the mamba-based models, all data is converted to the trajectory format by tools/gen_traj_data.py.
MOT17 dataset, run:
python tools/gen_traj_data.py --mot17 --save_name mot17DanceTrack dataset, run:
python tools/gen_traj_data.py --dancetrack --save_name dancetrackVisDrone dataset, run:
python tools/gen_traj_data.py --visdrone --save_name visdroneRemember to modify the DATA_ROOT according to your autual path
After running the code, a json file will be generated in ssm_tracker/traj_anno_data.
For inference, we preprocess the detection result first.
First things first, organize all the video frames in the subfoler images, and then test (or val), following the format: (same as YOLO format)
DanceTrack
|
|____images
|_____test
|_____dancetrack0001
|______xxxx.jpg
Then run the yolox detector:
python tools/gen_det_results.py --dataset_name dancetrack --data_root /data/datasets/DanceTrack/images/ --split val --exp_file yolox_exps/custom/yolox_x.py --model_path weights/yolox_dancetrack.pth.tar --generate_meta_datayou can refer to
experiments/gen_yolox_det_results.sh
The pretrained YOLOX-X model of DanceTrack can be downloaded from their huggingface repo. The detection results are provided in
./det_results
Some key package versions are as follows:
cython==3.0.11
cython-bbox==0.1.5
lap==0.5.12
loguru==0.7.3
opencv-python==4.7.0
torch==1.13.1+cu116
torchvision==0.14.1+cu116
yolox==0.1.0
mamba-ssm==2.2.3.post2
For installing yolox, please refer to ByteTrack, and for installing mamba-ssm, please refer to Mamba.
All mamba-like models are under ./ssm_tracker, and all kalman-like models are under ./kalman_tracker.
The architecture of MambaTrack is as follows:
The corresponding config file is ssm_tracker/cfgs/MambaTrack.yaml
The architecture of TrackSSM is as follows:
The corresponding config file is ssm_tracker/cfgs/TrackSSM.yaml
For training, please first modify the corresponding 'true' and 'false' in the bash file experiments/train_ssm_tracker.sh, and run:
sh experiments/train_ssm_tracker.shFor testing, please first modify the corresponding 'true' and 'false' in the bash file experiments/inference_ssm_tracker.sh, and modify the following arguments:
--det_path: the detection result files path, contains{seq_name}.txt--motion_model_path: the trained checkpoint path--config_file: same as train--data_root: your data root of the dataset, following the yolo format
Then run
sh experiments/train_ssm_tracker.sh