This repository contains YOLOX+ByteTrack integration source code.
The source code in the folder "tracker" is copied from ByteTrack repository. The folder "tracker" contains only the code required to run BYTETracker class.
For the original implementation please visit https://github.com/ifzhang/ByteTrack.
Installation
- Download YOLOX+ByteTrack integration source code from this repository. Open it as the root folder in your IDE
- Install python requirements
pip3 install -r tracker/requirements.txt
- Download and install CUDA on your PC
- Install pytorch with cuda support: generate command line using this manual
# This is an example of a command line, generated with https://pytorch.org/get-started/locally/
# This command will install pytorch v1.10 with coda 11.3
pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
- Install pycocotools
- For Ubuntu use:
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
- For Windows use:
pip3 install cython
pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
- Install cython_box
- For Ubuntu use:
pip3 install cython_bbox
- For Windows use:
pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox
- Clone YOLOX github repository and run setup
git clone https://github.com/Megvii-BaseDetection/YOLOX.git
cd YOLOX
python setup.py develop
cd ..
- Download YOLOX weights to weights folder from YOLOX repository
Standard Models (source: YOLOX repository).
Model | size | mAPval 0.5:0.95 |
mAPtest 0.5:0.95 |
Speed V100 (ms) |
Params (M) |
FLOPs (G) |
weights |
---|---|---|---|---|---|---|---|
YOLOX-s | 640 | 40.5 | 40.5 | 9.8 | 9.0 | 26.8 | github |
YOLOX-m | 640 | 46.9 | 47.2 | 12.3 | 25.3 | 73.8 | github |
YOLOX-l | 640 | 49.7 | 50.1 | 14.5 | 54.2 | 155.6 | github |
YOLOX-x | 640 | 51.1 | 51.5 | 17.3 | 99.1 | 281.9 | github |
YOLOX-Darknet53 | 640 | 47.7 | 48.0 | 11.1 | 63.7 | 185.3 | github |
Light Models (source: YOLOX repository).
Model | size | mAPval 0.5:0.95 |
Params (M) |
FLOPs (G) |
weights |
---|---|---|---|---|---|
YOLOX-Nano | 416 | 25.8 | 0.91 | 1.08 | github |
YOLOX-Tiny | 416 | 32.8 | 5.06 | 6.45 | github |
You can download this 4K traffic camera video from youtube (or download resized 720p version from google drive)
pip3 install youtube-dl
youtube-dl -f 313 MNn9qKG2UFI
# rename file 'MNn9qKG2UFI.webm' and put it into 'assets' folder
How to run
python .\main.py --name yolox-m --ckpt weights/yolox_m.pth --video_input assets/KarolMajek720.avi --video_output output_yolox_m.avi
python .\main_detector.py --name yolox-m --ckpt weights/yolox_m.pth --video_input assets/KarolMajek720.avi --video_output output_yolox-m-det.avi