Train OC-SORT models
masterOC-SORT can be used with existing detectors without training. However, if you wish to train your own detector, follow these guidelines. First, download the COCO-pretrained YOLOX weights and place them in <OCSORT_HOME>/pretrained.
Training Commands
- Ablation model (MOT17 half train and CrowdHuman):
python3 tools/train.py -f exps/example/mot/yolox_x_ablation.py -d 8 -b 48 --fp16 -o -c pretrained/yolox_x.pth- MOT17 test model (MOT17 train, CrowdHuman, Cityperson and ETHZ):
python3 tools/train.py -f exps/example/mot/yolox_x_mix_det.py -d 8 -b 48 --fp16 -o -c pretrained/yolox_x.pth- MOT20 test model (MOT20 train, CrowdHuman):
Note: For MOT20, you must manually uncomment specific code lines in the YOLOX source (related to box clipping in
data_augment,mosaicdetection.py, andboxes.py) before running.
python3 tools/train.py -f exps/example/mot/yolox_x_mix_mot20_ch.py -d 8 -b 48 --fp16 -o -c pretrained/yolox_x.pth- DanceTrack train set:
python3 tools/train.py -f exps/example/dancetrack/yolox_x.py -d 8 -b 48 --fp16 -o -c pretrained/yolox_x.pth- Custom dataset:
- Prepare your dataset in COCO format.
- Create an Exp file for your dataset (refer to the CrowdHuman example).
- Modify
get_data_loader()andget_eval_loader()in your Exp file. - Run training:
python3 tools/train.py -f exps/example/mot/your_exp_file.py -d 8 -b 48 --fp16 -o -c pretrained/yolox_x.pth