Skip to content

Files

Latest commit

Sep 15, 2023
57f928d · Sep 15, 2023

History

History
This branch is 48 commits behind lyuwenyu/RT-DETR:main.

rtdetr_pytorch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 15, 2023
Aug 22, 2023
Aug 21, 2023
Sep 1, 2023
Sep 1, 2023

TODO

  • Training
  • Evaluation
  • Export onnx
  • Upload source code
  • Align with the Paddle version
  • Upload weight convert from paddle

Quick start

Install
pip install -r requirements.txt
Data
  • Download and extract COCO 2017 train and val images.
path/to/coco/
  annotations/  # annotation json files
  train2017/    # train images
  val2017/      # val images
Training & Evaluation
  • Training on a Single GPU:
# training on single-gpu
export CUDA_VISIBLE_DEVICES=0
python tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml
  • Training on Multiple GPUs:
# train on multi-gpu
export CUDA_VISIBLE_DEVICES=0,1,2,3
torchrun --nproc_per_node=4 tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml
  • Evaluation on Multiple GPUs:
# val on multi-gpu
export CUDA_VISIBLE_DEVICES=0,1,2,3
torchrun --nproc_per_node=4 tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml -r path/to/checkpoint --test-only
Export
python tools/export_onnx.py -c configs/rtdetr/rtdetr_r18vd_6x_coco.yml -r path/to/checkpoint --check
Finetune

Set remap_mscoco_category: False. This var only works for ms-coco dataset.