依赖 Detectron2,需先按官方文档完成 Detectron2 及编译环境安装;预训练权重需从 Model Zoo 另行下载;PyTorch 版本需 1.10+,推荐 1.12。

detrex
IDEA-ResearchApache-2.0长期未更新基于 DETR 系列的目标检测研究平台,集成 DAB-DETR、DINO、Mask-DINO 等主流变体,方便复现和对比实验。
detrex is a research platform for DETR-based object detection, segmentation, pose estimation and other visual recognition tasks.
README 未给出具体安装命令,仅指向官方 Installation 文档:https://detrex.readthedocs.io/en/latest/tutorials/Installation.htmlREADME 未说明具体显存要求;仅说明主分支需 PyTorch 1.10+,推荐 1.12。
基于 Detectron2 的 DETR 系列检测算法研究平台,统一复现并基准测试多种 Transformer 检测模型
基于 DETR 系列的目标检测研究平台,集成 DAB-DETR、DINO、Mask-DINO 等主流变体,方便复现和对比实验。
核心能力
- 模块化拆解 Transformer 检测框架,便于自定义模型
- 集成 DETR、DINO、MaskDINO 等 20 余种算法
- 通过调优超参将基线提升 0.2 至 1.1 AP
- 采用 LazyConfig 配置系统,配置文件更简洁
- 提供轻量训练引擎与模型库、预训练权重
容易踩的坑
- v0.5.0detrex v0.5.0 Release最新正式版2023-07-16 · 2023-07-16 05:15 UTC
Release v0.5.0
Support New Algorithms and Benchmarks, including:
- Support Focus-DETR (ICCV'2023)
- Support SQR-DETR (CVPR'2023), credits to Fangyi Chen
- Support EVA-01 (CVPR'2023 Highlight)
- Support EVA-02 (ArXiv'2023)
- Support DINO-EVA benchmarks, including
dino-eva-01anddino-eva-02with LSJ augmentation. - Support Align-DETR (ArXiv'2023), credits to Zhi Cai
All the pretrained DINO-EVA checkpoints can be downloaded in Huggingface Space
- v0.4.0detrex v0.4.0 Release2023-06-02 · 2023-06-02 09:26 UTC
查看更新说明
Main updates
- Support CO-MOT aims for End-to-End Multi-Object Tracking by Feng Yan.
- Release
DINOwith optimized hyper-parameters which achieves50.0 APunder 1x settings. - Release pretrained DINO based on
InternImage,ConvNeXt-1K pretrainedbackbones. - Release
Deformable-DETR-R50pretrained weights. - Release
DETAand betterH-DETRpretrained weights: achieving50.2 APand49.1 APrespectively.
Pretrained Model
DETA-R50-5scale-12epbs=8:50.0APDETA-R50-5scale-12epaligned hyper-param:49.9APDETA-R50-5scale-12epwith only freeze the stem of backbone:50.2APH-Deformable-DETR-two-stage-R50-12epaligned optimizer hyper-params:49.1APDINO-R50-4scale-12epaligned optimizer hyper-params:49.4APDINO-Focal-3level-4scale-36ep:58.3AP
Benchmark ConvNeXt on DINO
- convnext-tiny-384:
52.4AP - convnext-small-384:
54.2AP - convnext-base-384:
55.1AP - convnext-large-384:
55.5AP
Benchmark InternImage on DINO
- internimage-tiny:
52.3AP - internimage-small:
53.5AP - internimage-base:
54.7AP - internimage-large:
57.0AP
Benchmark FocalNet on DINO
- focalnet-tiny
- focalnet-small
- focalnet-base
Other pre-trained weights
- Deformable-DETR R50:
44.9 AP(better than 44.5AP from original repo) Group-DETR-R50-12ep:37.8AP
- v0.3.0detrex v0.3.0 Release2023-03-17 · 2023-03-17 09:47 UTC
查看更新说明
What's New
New Algorithms
- Support
Anchor-DETR - Support
DETA
More training techniques
- Support
EMAHookduring training by settingtrain.model_ema.enabled=True, which can further enhance the model performance. - Fully support mixed precision training by setting
train.amp.enabled=True, which can reduce 20% to 30% GPU memory usage. - Support encoder-decoder checkpoint in DINO which may reduce 30% GPU memory usage. And for more details about the checkpoint usage, please refer to this PR: #200
- Support fast debugging by setting
train.fast_dev_run=True. - Support a great slurm training scripts by @rayleizhu , please check this issue #213 for more details.
Release more than 10+ pretrained checkpoints
Method Pretrained Epochs Box AP DETR-R50-DC5 IN1k 500 43.4 DETR-R101-DC5 IN1k 500 44.9 Anchor-DETR-R50 IN1k 50 42.2 Anchor-DETR-R50-DC5 IN1k 50 44.2 Anchor-DETR-R101 IN1k 50 43.5 Anchor-DETR-R101-DC5 IN1k 50 45.1 Conditional-DETR-R50-DC5 IN1k 50 43.8 Conditional-DETR-R101 IN1k 50 43.0 Conditional-DETR-R101 -DC5 IN1k 50 45.1 DAB-DETR-R50-3patterns IN1k 50 42.8 DAB-DETR-R50-DC5 IN1k 50 44.6 DAB-DETR-R50-DC5-3patterns IN1k 50 45.7 DAB-DETR-101-DC5 IN1k 50 45.7 DN-DETR-R50-DC5 IN1k 50 46.3 DINO with EMA IN1k 12 49.4 DETA-R50-5scale IN1k 12 50.1 DETA-Swin-Large object-365 24 62.9 Part of the pre-trained weights are converted from their official repo, and all the pre-trained weights can be downloaded in detrex Model Zoo
- Support
- v0.2.1detrex v0.2.1 Release2023-02-01 · 2023-02-01 07:16 UTC
查看更新说明
Highlights
- DINO has been accepted to ICLR 2023!
- Thanks a lot for @powermano provides us a detailed usage about onnx export in detrex. Please see this issue https://github.com/IDEA-Research/detrex/issues/192
What's New
New Algorithm
- MaskDINO COCO instance-seg/panoptic-seg pre-release #154
New Features
- New baselines for
Res/Swin-DINO-5scale,ViTDet-DINO,FocalNet-DINO, etc. #138, #155 - Support FocalNet backbone #145
- Support Swin-V2 backbone #152
Documentation
- Add ViTDet / FocalNet download links and usage example, please refer to Download Pretrained Weights.
- Add tutorial on how to verify the correct installation of detrex. #194
Bug Fixes
- Fix demo confidence filter not to remove mask predictions #156
Code Refinement
- Make more readable logging info for criterion and matcher #151
- Modified learning rate scheduler config usage, add fundamental scheduler configuration #191
New Pretrained Models
All the pretrained weights can be downloaded in detrex Model Zoo
DINO
Method Pretrained Epochs Box AP DINO-ViTDet-Base-4scale MAE 12 50.2 DINO-ViTDet-Base-4scale MAE 50 55.0 DINO-ViTDet-Large-4scale MAE 12 50.2 DINO-ViTDet-Large-4scale MAE 50 55.0 DINO-FocalNet-Large-3level-4scale IN22k 12 57.5 DINO-FocalNet-Large-4level-4scale IN22k 12 58.0 DINO-FocalNet-Large-4level-5scale IN22k 12 58.5 - maskdinoMaskDINO Release2022-12-02 · 2022-12-02 10:51 UTC
查看更新说明
MaskDINO Release
- Release for MaskDINO Source Code: MaskDINO
- The detrex version can be found in projects/maskdino
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
📚Read detrex Benchmarking Paper | 🏠Project Page | 🏷️Cite detrex | 🚢DeepDataSpace
📘Documentation | 🛠️Installation | 👀Model Zoo | 🚀Awesome DETR | 🆕News | 🤔Reporting Issues
Introduction
detrex is an open-source toolbox that provides state-of-the-art Transformer-based detection algorithms. It is built on top of Detectron2 and its module design is partially borrowed from MMDetection and DETR. Many thanks for their nicely organized code. The main branch works with Pytorch 1.10+ or higher (we recommend Pytorch 1.12).
-
Modular Design. detrex decomposes the Transformer-based detection framework into various components which help users easily build their own customized models.
-
Strong Baselines. detrex provides a series of strong baselines for Transformer-based detection models. We have further boosted the model performance from 0.2 AP to 1.1 AP through optimizing hyper-parameters among most of the supported algorithms.
-
Easy to Use. detrex is designed to be light-weight and easy for users to use:
- LazyConfig System for more flexible syntax and cleaner config files.
- Light-weight training engine modified from detectron2 lazyconfig_train_net.py
Apart from detrex, we also released a repo Awesome Detection Transformer to present papers about Transformer for detection and segmentation.
Fun Facts
The repo name detrex has several interpretations:
-
detr-ex : We take our hats off to DETR and regard this repo as an extension of Transformer-based detection algorithms.
-
det-rex : rex literally means 'king' in Latin. We hope this repo can help advance the state of the art on object detection by providing the best Transformer-based detection algorithms from the research community.
-
de-t.rex : de means 'the' in Dutch. T.rex, also called Tyrannosaurus Rex, means 'king of the tyrant lizards' and connects to our research work 'DINO', which is short for Dinosaur.
What's New
v0.5.0 was released on 16/07/2023:
- Support Focus-DETR (ICCV'2023).
- Support SQR-DETR (CVPR'2023), credits to Fangyi Chen
- Support Align-DETR (ArXiv'2023), credits to Zhi Cai
- Support EVA-01 (CVPR'2023 Highlight) and EVA-02 (ArXiv'2023) backbones, please check DINO-EVA for more benchmarking results.
Please see changelog.md for details and release history.
Installation
Please refer to Installation Instructions for the details of installation.
Getting Started
Please refer to Getting Started with detrex for the basic usage of detrex. We also provides other tutorials for:
- Learn about the config system of detrex
- How to convert the pretrained weights from original detr repo into detrex format
- Visualize your training data and testing results on COCO dataset
- Analyze the model under detrex
- Download and initialize with the pretrained backbone weights
- Frequently asked questions
- A simple onnx convert tutorial provided by powermano
- Simple training techniques: Model-EMA, Mixed Precision Training, Activation Checkpoint
- Simple tutorial about custom dataset training
Although some of the tutorials are currently presented with relatively simple content, we will constantly improve our documentation to help users achieve a better user experience.
Documentation
Please see documentation for full API documentation and tutorials.
Model Zoo
Results and models are available in model zoo.
- DETR (ECCV'2020)
- Deformable-DETR (ICLR'2021 Oral)
- PnP-DETR (ICCV'2021)
- Conditional-DETR (ICCV'2021)
- Anchor-DETR (AAAI 2022)
- DAB-DETR (ICLR'2022)
- DAB-Deformable-DETR (ICLR'2022)
- DN-DETR (CVPR'2022 Oral)
- DN-Deformable-DETR (CVPR'2022 Oral)
- Group-DETR (ICCV'2023)
- DETA (ArXiv'2022)
- DINO (ICLR'2023)
- H-Deformable-DETR (CVPR'2023)
- MaskDINO (CVPR'2023)
- CO-MOT (ArXiv'2023)
- SQR-DETR (CVPR'2023)
- Align-DETR (ArXiv'2023)
- EVA-01 (CVPR'2023 Highlight)
- EVA-02 (ArXiv'2023)
- Focus-DETR (ICCV'2023)
Please see projects for the details about projects that are built based on detrex.
License
This project is released under the Apache 2.0 license.
Acknowledgement
- detrex is an open-source toolbox for Transformer-based detection algorithms created by researchers of IDEACVR. We appreciate all contributions to detrex!
- detrex is built based on Detectron2 and part of its module design is borrowed from MMDetection, DETR, and Deformable-DETR.
Citation
If you use this toolbox in your research or wish to refer to the baseline results published here, please use the following BibTeX entries:
- Citing detrex:
@misc{ren2023detrex,
title={detrex: Benchmarking Detection Transformers},
author={Tianhe Ren and Shilong Liu and Feng Li and Hao Zhang and Ailing Zeng and Jie Yang and Xingyu Liao and Ding Jia and Hongyang Li and He Cao and Jianan Wang and Zhaoyang Zeng and Xianbiao Qi and Yuhui Yuan and Jianwei Yang and Lei Zhang},
year={2023},
eprint={2306.07265},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@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}
}
@inproceedings{
zhu2021deformable,
title={Deformable {\{}DETR{\}}: Deformable Transformers for End-to-End Object Detection},
author={Xizhou Zhu and Weijie Su and Lewei Lu and Bin Li and Xiaogang Wang and Jifeng Dai},
booktitle={International Conference on Learning Representations},
year={2021},
url={https://openreview.net/forum?id=gZ9hCDWe6ke}
}
@inproceedings{meng2021-CondDETR,
title = {Conditional DETR for Fast Training Convergence},
author = {Meng, Depu and Chen, Xiaokang and Fan, Zejia and Zeng, Gang and Li, Houqiang and Yuan, Yuhui and Sun, Lei and Wang, Jingdong},
booktitle = {Proceedings of the IEEE International Conference on Computer Vision (ICCV)},
year = {2021}
}
@inproceedings{
liu2022dabdetr,
title={{DAB}-{DETR}: Dynamic Anchor Boxes are Better Queries for {DETR}},
author={Shilong Liu and Feng Li and Hao Zhang and Xiao Yang and Xianbiao Qi and Hang Su and Jun Zhu and Lei Zhang},
booktitle={International Conference on Learning Representations},
year={2022},
url={https://openreview.net/forum?id=oMI9PjOb9Jl}
}
@inproceedings{li2022dn,
title={Dn-detr: Accelerate detr training by introducing query denoising},
author={Li, Feng and Zhang, Hao and Liu, Shilong and Guo, Jian and Ni, Lionel M and Zhang, Lei},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={13619--13627},
year={2022}
}
@inproceedings{
zhang2023dino,
title={{DINO}: {DETR} with Improved DeNoising Anchor Boxes for End-to-End Object Detection},
author={Hao Zhang and Feng Li and Shilong Liu and Lei Zhang and Hang Su and Jun Zhu and Lionel Ni and Heung-Yeung Shum},
booktitle={The Eleventh International Conference on Learning Representations },
year={2023},
url={https://openreview.net/forum?id=3mRwyG5one}
}
@InProceedings{Chen_2023_ICCV,
author = {Chen, Qiang and Chen, Xiaokang and Wang, Jian and Zhang, Shan and Yao, Kun and Feng, Haocheng and Han, Junyu and Ding, Errui and Zeng, Gang and Wang, Jingdong},
title = {Group DETR: Fast DETR Training with Group-Wise One-to-Many Assignment},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
month = {October},
year = {2023},
pages = {6633-6642}
}
@InProceedings{Jia_2023_CVPR,
author = {Jia, Ding and Yuan, Yuhui and He, Haodi and Wu, Xiaopei and Yu, Haojun and Lin, Weihong and Sun, Lei and Zhang, Chao and Hu, Han},
title = {DETRs With Hybrid Matching},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2023},
pages = {19702-19712}
}
@InProceedings{Li_2023_CVPR,
author = {Li, Feng and Zhang, Hao and Xu, Huaizhe and Liu, Shilong and Zhang, Lei and Ni, Lionel M. and Shum, Heung-Yeung},
title = {Mask DINO: Towards a Unified Transformer-Based Framework for Object Detection and Segmentation},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2023},
pages = {3041-3050}
}
@article{yan2023bridging,
title={Bridging the Gap Between End-to-end and Non-End-to-end Multi-Object Tracking},
author={Yan, Feng and Luo, Weixin and Zhong, Yujie and Gan, Yiyang and Ma, Lin},
journal={arXiv preprint arXiv:2305.12724},
year={2023}
}
@InProceedings{Chen_2023_CVPR,
author = {Chen, Fangyi and Zhang, Han and Hu, Kai and Huang, Yu-Kai and Zhu, Chenchen and Savvides, Marios},
title = {Enhanced Training of Query-Based Object Detection via Selective Query Recollection},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2023},
pages = {23756-23765}
}