YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and industrial communities. For more details, please refer to the report on Arxiv.
This repository is an implementation of PyTorch version YOLOX, there is also a MegEngine implementation.
This repository is a fork of the original by [Megvii] (https://github.com/Megvii-BaseDetection/YOLOX), and contains new improvements and modifications.
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 |
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 |
Clone this repository and install locally with a virtual environment.
git clone https://github.com/natsunoyuki/YOLOX
cd YOLOX
python3 -m venv venv
source venv/bin/activate
pip3 install -e .
Various scripts for training, evaluating and predicting are available under tools/
, while the corresponding configuration YAML files should be placed under tools_configs/
. A default set of configuration files are available under tools_configs/
, and additional files may be created and passed to the script as an argument.
By convention, all training data should be in the MS-COCO format. The images for the train, validation and test splits should be placed under individual folders train2017/
, val2017/
and test2017/
, and all annotation JSON files should be placed under annotations/
as in the tree below. The object detection bounding box annotations should be in the MS-COCO format: [x0, y0, w, h]
.
datasets/
├── data_dir_1
├── ...
└── data_dir_N
├── train2017/
│ └── *.jpg
├── val2017/
│ └── *.jpg
├── test2017/
│ └── *.jpg
└── annotations
├── instances_train2017.json
├── instances_val2017.json
└── instances_test2017.json
After placing the training data and "exp" file (see section below) in the appropriate locations, set up the training configurations in tools_configs/<data-name>/train.yaml
, and run the training script:
python3 tools/train.py --config_dir tools_configs/<data-name>/ --config train.yaml
After placing the evaluation data and "exp" file (see section below) in the appropriate locations, set up the evaluation configurations in tools_config/<data-name>/evaluate.yaml
, and run the evaluation script:
python3 tools/evaluate.py --config_dir tools_configs/<data-name>/ --config evaluate.yaml
After placing the prediction data and "exp" file (see section below) in the appropriate locations, set up the prediction configurations in tools_config/<data-name>/predict.yaml
, and run the prediction script:
python3 tools/predict.py --config_dir tools_configs/<data-name>/ --config predict.yaml
Settings for YOLOX models are defined in "exp" .py
files under exps/
. These files contain model settings such as the model depth and width, the number of classes in the data, the location of the data, the number of training epochs etc. A new "exp" file should be created for each new experiment, which will be used for training, evaluating and predicting with the model. Some example "exp" files are provided under exps/default/
and exps/example/custom/
. Additionally, some other "exp" files for datasets found on Kaggle such as exps/example/kaggle_dog_and_cat/
are also available as examples on how to craft "exp" files for custom data.
- MegEngine in C++ and Python
- ONNX export and an ONNXRuntime
- TensorRT in C++ and Python
- ncnn in C++ and Java
- OpenVINO in C++ and Python
- Accelerate YOLOX inference with nebullvm in Python
- YOLOX for streaming perception: StreamYOLO (CVPR 2022 Oral)
- The YOLOX-s and YOLOX-nano are Integrated into ModelScope. Try out the Online Demo at YOLOX-s and YOLOX-Nano respectively 🚀.
- Integrated into Huggingface Spaces 🤗 using Gradio. Try out the Web Demo:
- The ncnn android app with video support: ncnn-android-yolox from FeiGeChuanShu
- YOLOX with Tengine support: Tengine from BUG1989
- YOLOX + ROS2 Foxy: YOLOX-ROS from Ar-Ray
- YOLOX Deploy DeepStream: YOLOX-deepstream from nanmi
- YOLOX MNN/TNN/ONNXRuntime: YOLOX-MNN、YOLOX-TNN and YOLOX-ONNXRuntime C++ from DefTruth
- Converting darknet or yolov5 datasets to COCO format for YOLOX: YOLO2COCO from Daniel
If you use YOLOX in your research, please cite the original authors' work by using the following BibTeX entry:
@article{yolox2021,
title={YOLOX: Exceeding YOLO Series in 2021},
author={Ge, Zheng and Liu, Songtao and Wang, Feng and Li, Zeming and Sun, Jian},
journal={arXiv preprint arXiv:2107.08430},
year={2021}
}
Without the guidance of Dr. Jian Sun, YOLOX would not have been released and open sourced to the community. The passing away of Dr. Sun is a huge loss to the Computer Vision field. We add this section here to express our remembrance and condolences to our captain Dr. Sun. It is hoped that every AI practitioner in the world will stick to the belief of "continuous innovation to expand cognitive boundaries, and extraordinary technology to achieve product value" and move forward all the way.