未验证 提交 ae2ff473 编写于 作者: W Wenyu 提交者: GitHub

update rtdetr doc (#8207)

* update rtdetr doc
上级 597ee656
......@@ -2,8 +2,9 @@
## 最新动态
- 发布RT-DETR-R50和RT-DETR-R101的代码和预训练模型。
- 发布RT-DETR-L和RT-DETR-X的代码和预训练模型。
- 发布RT-DETR-R50和RT-DETR-R101的代码和预训练模型
- 发布RT-DETR-L和RT-DETR-X的代码和预训练模型
- 发布RT-DETR-R50-Scaled伸缩更小的范例模型
## 简介
<!-- We propose a **R**eal-**T**ime **DE**tection **TR**ansformer (RT-DETR), the first real-time end-to-end object detector to our best knowledge. Specifically, we design an efficient hybrid encoder to efficiently process multi-scale features by decoupling the intra-scale interaction and cross-scale fusion, and propose IoU-aware query selection to improve the initialization of object queries. In addition, our proposed detector supports flexibly adjustment of the inference speed by using different decoder layers without the need for retraining, which facilitates the practical application of real-time object detectors. Our RT-DETR-L achieves 53.0% AP on COCO val2017 and 114 FPS on T4 GPU, while RT-DETR-X achieves 54.8% AP and 74 FPS, outperforming all YOLO detectors of the same scale in both speed and accuracy. Furthermore, our RT-DETR-R50 achieves 53.1% AP and 108 FPS, outperforming DINO-Deformable-DETR-R50 by 2.2% AP in accuracy and by about 21 times in FPS. -->
......@@ -11,18 +12,19 @@ RT-DETR是第一个实时端到端目标检测器。具体而言,我们设计
若要了解更多细节,请参考我们的论文[paper](https://arxiv.org/abs/2304.08069).
<div align="center">
<img src="https://user-images.githubusercontent.com/77494834/232970879-0f26a14d-5864-4532-97ba-85a0b3443e09.png" width=500 />
<img src="https://user-images.githubusercontent.com/17582080/236754415-992054df-fbb5-46c6-953e-89a0e183b824.png" width=500 />
</div>
## 模型
| Model | Epoch | backbone | input shape | $AP^{val}$ | $AP^{val}_{50}$| Params(M) | FLOPs(G) | T4 TensorRT FP16(FPS) | Pretrained Model | config |
|:--------------:|:-----:|:----------:| :-------:|:--------------------------:|:---------------------------:|:---------:|:--------:| :---------------------: |:------------------------------------------------------------------------------------:|:-------------------------------------------:|
| RT-DETR-R50-scaled | 6x | ResNet-50 | 640 | 51.3 | - | - | - | 145 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_m_6x_coco.pdparams) | [config](./rtdetr_r50vd_m_6x_coco.yml)
| RT-DETR-R50 | 6x | ResNet-50 | 640 | 53.1 | 71.3 | 42 | 136 | 108 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_6x_coco.pdparams) | [config](./rtdetr_r50vd_6x_coco.yml)
| RT-DETR-R101 | 6x | ResNet-101 | 640 | 54.3 | 72.7 | 76 | 259 | 74 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_r101vd_6x_coco.pdparams) | [config](./rtdetr_r101vd_6x_coco.yml)
| RT-DETR-L | 6x | HGNetv2 | 640 | 53.0 | 71.6 | 32 | 110 | 114 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_hgnetv2_l_6x_coco.pdparams) | [config](rtdetr_hgnetv2_l_6x_coco.yml)
| RT-DETR-X | 6x | HGNetv2 | 640 | 54.8 | 73.1 | 67 | 234 | 74 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_hgnetv2_x_6x_coco.pdparams) | [config](rtdetr_hgnetv2_x_6x_coco.yml)
| RT-DETR-R50-Scaled | 6x | ResNet-50 | 640 | 51.3 | 69.6 | 35 | 100 | 145 | [download](https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_m_6x_coco.pdparams) | [config](./rtdetr_r50vd_m_6x_coco.yml)
**注意事项:**
- RT-DETR 使用4个GPU训练。
......@@ -84,8 +86,6 @@ python tools/infer.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml \
## 部署
### 导出及转换模型
<details open>
<summary>1. 导出模型 </summary>
......@@ -117,11 +117,15 @@ paddle2onnx --model_dir=./output_inference/rtdetr_r50vd_6x_coco/ \
--opset_version 16 \
--save_file rtdetr_r50vd_6x_coco.onnx
```
</details>
- 转换成TensorRT(可选):
<details>
<summary>3. 转换成TensorRT(可选) </summary>
- 确保TensorRT的版本>=8.5.1
- 推理可以[参考例子的部分代码](https://github.com/lyuwenyu/AI/tree/master/rt)或者其他网络资源
```shell
# 保证TensorRT的版本>=8.5.1
trtexec --onnx=./rtdetr_r50vd_6x_coco.onnx \
--workspace=4096 \
--shapes=image:1x3x640x640 \
......@@ -130,8 +134,44 @@ trtexec --onnx=./rtdetr_r50vd_6x_coco.onnx \
--fp16
```
-
</details>
## 其他
<details>
<summary>1. 参数量和计算量统计 </summary>
可以使用以下代码片段实现参数量和计算量的统计
```
import paddle
from ppdet.core.workspace import load_config, merge_config
from ppdet.core.workspace import create
cfg_path = './configs/dino/ppdetr_r50_3x_coco.yml'
cfg = load_config(cfg_path)
model = create(cfg.architecture)
blob = {
'image': paddle.randn([1, 3, 640, 640]),
'im_shape': paddle.to_tensor([[640], [640]]),
'scale_factor': paddle.to_tensor([[1.], [1.]])
}
paddle.flops(model, None, blob, custom_ops=None, print_detail=False)
```
</details>
<details>
<summary>2. YOLOs端到端速度测速 </summary>
- 可以[参考的部分代码](https://github.com/lyuwenyu/AI/tree/master/rt)或者其他网络资源
</details>
## 引用RT-DETR
如果需要在你的研究中使用RT-DETR,请通过以下方式引用我们的论文:
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册