This project adapts ByteTrack for soccer player tracking using the SoccerNet dataset. It explores alternative approaches for improving multi-object tracking accuracy in complex scenarios like soccer games, but the results indicate that not all modifications yield improvements.
The primary aim is to investigate and analyze enhancements to ByteTrack to address challenges such as:
- Non-linear motion modeling.
- Frequent occlusions in dynamic environments.
- Dense overlaps among tracked objects.
Proposed modifications include:
- Replacing the Kalman filter with an LSTM model for improved motion prediction.
- Using Distance IOU (DIoU) for more precise overlap measurements.
- Introducing a decay weight for unmatched track management.
Step1. Install ByteTrack.
git clone https://github.com/ifzhang/ByteTrack.git
cd ByteTrack
pip3 install -r requirements.txt
python3 setup.py developStep2. Install pycocotools.
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'Step3. Others
pip3 install cython_bboxdocker build -t bytetrack:latest .
# Startup sample
mkdir -p pretrained && \
mkdir -p YOLOX_outputs && \
xhost +local: && \
docker run --gpus all -it --rm \
-v $PWD/pretrained:/workspace/ByteTrack/pretrained \
-v $PWD/datasets:/workspace/ByteTrack/datasets \
-v $PWD/YOLOX_outputs:/workspace/ByteTrack/YOLOX_outputs \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
--device /dev/video0:/dev/video0:mwr \
--net=host \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e DISPLAY=$DISPLAY \
--privileged \
bytetrack:latestTrain the LSTM model with the following command:
cd LSTM
python model.pymodel will be saved at ./LSTM
Train on CrowdHuman and MOT20 datasets, and evaluate on MOT20 train. Pretrained models:
| Model | MOTA | IDF1 | IDs | FPS |
|---|---|---|---|---|
| bytetrack_x_mot20 [google], [baidu(code:3apd)] | 93.4 | 89.3 | 1057 | 17.5 |
Place the pretrained model in the /pretrained directory.
Run inference for each sequence:
- Set up the environment:
export ByteTrack_HOME=<ByteTrack_HOME>
cd <ByteTrack_HOME>
export SN_TRACKING_MODE=test
bash run_bytetrack_no_gt_batch.shFor detailed arguments, see tools/demo_track_no_gt.py 2. For challenge mode:
export SN_TRACKING_MODE=challengeTo evaluate results locally:
- Generate
gt.zip:
python eval/zip_gt.py -f Dataset/tracking/test/- Zip Tracker Results:
cd <RESULT_FOLDER> # e.g., YOLOX_outputs/yolox_x_soccernet_no_gt/track_vis
zip soccernet_mot_results.zip SNMOT-???.txt- Prepare for Evaluation: Move
gt.zipandsoccernet_mot_results.zipto theevalfolder:
cd eval- Run Evaluation: Install the evaluation tool and execute the script:
pip install git+https://github.com/JonathonLuiten/TrackEval.git
python evaluate_soccernet_v3_tracking.py \
--TRACKERS_FOLDER_ZIP soccernet_mot_results.zip \
--GT_FOLDER_ZIP gt.zip \
--BENCHMARK SNMOT \
--DO_PREPROC False \
--SEQMAP_FILE SNMOT-test.txt \
--TRACKERS_TO_EVAL test \
--SPLIT_TO_EVAL test \
--OUTPUT_SUB_FOLDER eval_results- Motion Modeling: Integration of LSTM to explore non-linear motion tracking.
- Overlap Metrics: Use of Distance IOU to handle dense overlaps.
- Track Retention: Implementation of a decay weight mechanism for unmatched tracks.
- Comprehensive Evaluation: Supports metrics such as HOTA, MOTA, and ASSA.