Spaces:
Runtime error
DETR: End-to-End Object Detection with Transformers
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, Sergey Zagoruyko

We reproduce DETR in detrex based on Detectron2 wrapper for DETR.
Converted Weights
Here we provides the weights which are converted by converter.py from the official DETR repo.
Name | Backbone | Pretrain | Epochs | box AP |
download |
---|---|---|---|---|---|
DETR-R50 | R-50 | IN1k | 500 | 42.0 | model |
DETR-R50-DC5 | R-50 | IN1k | 500 | 43.4 | model |
DETR-R101 | R-101 | IN1k | 500 | 43.5 | model |
DETR-R101-DC5 | R-101 | IN1k | 500 | 44.9 | model |
Note: Here we borrowed the pretrained weight from DETR official repo. And our detrex training results will be released in the future version.
Training
Training DETR model for 300 epochs:
cd detrex
python tools/train_net.py --config-file projects/detr/configs/detr_r50_300ep.py --num-gpus 8
By default, we use 8 GPUs with total batch size as 64 for training.
Evaluation
Model evaluation can be done as follows:
cd detrex
python tools/train_net.py --config-file projects/detr/configs/path/to/config.py \
--eval-only train.init_checkpoint=/path/to/model_checkpoint
Evaluating the official DETR model
Using the modified conversion script to convert models trained by the official DETR training loop into the format of detrex model. To download and evaluate DETR-R50
model, simply run:
cd detrex
python projects/detr/converter.py \
--source_model https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth \
--output_model converted_detr_r50_model.pth
Then evaluate the converted model like:
python tools/train_net.py --config-file projects/detr/configs/detr_r50_300ep.py \
--eval-only train.init_checkpoint="./converted_detr_r50_model.pth"
Citing DETR
@inproceedings{carion2020end,
title={End-to-end object detection with transformers},
author={Carion, Nicolas and Massa, Francisco and Synnaeve, Gabriel and Usunier, Nicolas and Kirillov, Alexander and Zagoruyko, Sergey},
booktitle={European conference on computer vision},
pages={213--229},
year={2020},
organization={Springer}
}