This model is not yet complete.
| Model |
Batch |
Scale |
APval 0.5:0.95
| APval 0.5
| FLOPs (G)
| Params (M)
| Weight |
| RT-DETR-R18 |
2xb8 |
640 |
|
|
|
|
|
| RT-DETR-R50 |
2xb8 |
640 |
|
|
|
|
|
| RT-DETR-R101 |
2xb8 |
640 |
|
|
|
|
|
- For the backbone of the image encoder, we use the IN-1K classification pretrained weight. It might be hard to train RT-DETR from scratch without IN-1K pretrained weight.
- For training, we train RT-DETR series with 6x (~72 epochs) schedule on COCO.
- For data augmentation, we use the
color jitter, random hflip, random crop, and multi-scale training trick.
- For optimizer, we use AdamW with weight decay 0.0001 and base per image lr 0.001 / 16.
- For learning rate scheduler, we use
cosine decay scheduler.
Train RT-DETR
Single GPU
Taking training RT-DETR-R18 on COCO as the example,
python train.py --cuda -d coco --root path/to/coco -m rtdetr_r18 -bs 16 -size 640 --max_epoch 72 --eval_epoch 5 --no_aug_epoch -1 --ema --fp16 --multi_scale
Multi GPU
Taking training RT-DETR-R18 on COCO as the example,
python -m torch.distributed.run --nproc_per_node=8 train.py --cuda -dist -d coco --root /data/datasets/ -m rtdetr_r18 -bs 16 -size 640 --max_epoch 72 --eval_epoch 5 --no_aug_epoch -1 --ema --fp16 --sybn --multi_scale --save_folder weights/
Test RT-DETR
Taking testing RT-DETR-R18 on COCO-val as the example,
python test.py --cuda -d coco --root path/to/coco -m rtdetr_r18 --weight path/to/rtdetr_r18.pth -size 640 -vt 0.4 --show
Evaluate RT-DETR
Taking evaluating RT-DETR-R18 on COCO-val as the example,
python eval.py --cuda -d coco-val --root path/to/coco -m rtdetr_r18 --weight path/to/rtdetr_r18.pth
Demo
Detect with Image
python demo.py --mode image --path_to_img path/to/image_dirs/ --cuda -m rtdetr_r18 --weight path/to/weight -size 640 -vt 0.4 --show
Detect with Video
python demo.py --mode video --path_to_vid path/to/video --cuda -m rtdetr_r18 --weight path/to/weight -size 640 -vt 0.4 --show --gif
Detect with Camera
python demo.py --mode camera --cuda -m rtdetr_r18 --weight path/to/weight -size 640 -vt 0.4 --show --gif