Skip to content

Latest commit

 

History

History
140 lines (103 loc) · 4.58 KB

README.md

File metadata and controls

140 lines (103 loc) · 4.58 KB

Introduce

YOLOX for Paddle 2.1, YOLOX's Paper report on Arxiv.

Benchmark

Standard Models.

Model size mAPtest
0.5:0.95
Speed V100
(ms)
Params
(M)
FLOPs
(G)
weights
YOLOX-s 640 39.6 9.8 9.0 26.8 github
YOLOX-m 640 46.4 12.3 25.3 73.8 github
YOLOX-l 640 50.0 14.5 54.2 155.6 github
YOLOX-x 640 51.2 17.3 99.1 281.9 github

Light Models.

Model size mAPval
0.5:0.95
Params
(M)
FLOPs
(G)
weights
YOLOX-Nano 416 25.3 0.91 1.08 github
YOLOX-Tiny 416 32.8 5.06 6.45 github

Quick Start

Installation

Step1. Install YOLOX.

git clone [email protected]:jesse01/paddle-yolox.git

Step2. Install apex.

# skip this step if you don't want to train model.
git clone https://github.com/NVIDIA/apex
cd apex
pip3 install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Step3. Install pycocotools.

pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
Demo

Step1. Download a pretrained model from the benchmark table.

Step2. Use either -n or -f to specify your detector's config. For example:

python tools/demo.py image -n yolox-s -c /path/to/your/yolox_s.pth --path assets/dog.jpg --conf 0.30 --nms 0.45 --tsize 640 --save_result

or

python tools/demo.py image -f exps/default/yolox_s.py -c /path/to/your/yolox_s.pth --path assets/dog.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result

Demo for video:

python tools/demo.py video -n yolox-s -c /path/to/your/yolox_s.pth --path /path/to/your/video --conf 0.25 --nms 0.45 --tsize 640 --save_result
Reproduce our results on COCO

Step1. Prepare COCO dataset

cd <YOLOX_HOME>
ln -s /path/to/your/COCO ./datasets/COCO

Step2. Reproduce our results on COCO by specifying -n:

python tools/train.py -n yolox-s -b 8 -o
                         yolox-m
                         yolox-l
                         yolox-x
  • -m: paddle.distributed.launch, multiple gpu training
  • -b: total batch size, the recommended number for -b is num-gpu * 8

Multi GPU Training

python -m paddle.distributed.launch tools/train.py -n yolox-s -b 64 -o yolox-m yolox-l yolox-x

When using -f, the above commands are equivalent to:

python tools/train.py -f exps/default/yolox-s.py  -b 64 -o
                         exps/default/yolox-m.py
                         exps/default/yolox-l.py
                         exps/default/yolox-x.py
Evaluation

We support batch testing for fast evaluation:

python tools/eval.py -n  yolox-s -c yolox_s.pth -b 8 --conf 0.001 [--fuse]
                         yolox-m
                         yolox-l
                         yolox-x
  • --fuse: fuse conv and bn
  • -b: total batch size across on all GPUs

To reproduce speed test, we use the following command:

python tools/eval.py -n  yolox-s -c yolox_s.pth -b 1 --conf 0.001 --fuse
                         yolox-m
                         yolox-l
                         yolox-x

Third-party resources