docs: make Chinese README the default
CPU tests Workflow / build-pkg (push) Failing after 15m1s
PR Conflict Labeler / labeling (push) Has been cancelled
Docs/Test WorkFlow / Test docs build (push) Has been cancelled
Smoke Tests / try-all-models (macos-latest, 3.10) (push) Has been cancelled
Smoke Tests / try-all-models (macos-latest, 3.13) (push) Has been cancelled
Mypy Type Check / Type Check (push) Has been cancelled
Smoke Tests / try-all-models (ubuntu-latest, 3.10) (push) Has been cancelled
Smoke Tests / try-all-models (ubuntu-latest, 3.13) (push) Has been cancelled
Smoke Tests / try-all-models (windows-latest, 3.10) (push) Has been cancelled
Smoke Tests / try-all-models (windows-latest, 3.13) (push) Has been cancelled
GPU tests Workflow / Testing (push) Has been cancelled
CPU tests Workflow / Testing (ubuntu-latest, 3.11) (push) Has been cancelled
CPU tests Workflow / Testing (ubuntu-latest, 3.12) (push) Has been cancelled
CPU tests Workflow / Testing (ubuntu-latest, 3.13) (push) Has been cancelled
CPU tests Workflow / Testing (windows-latest, 3.10) (push) Has been cancelled
CPU tests Workflow / Testing (windows-latest, 3.13) (push) Has been cancelled
CPU tests Workflow / Testing (macos-latest, 3.10) (push) Has been cancelled
CPU tests Workflow / Testing (macos-latest, 3.13) (push) Has been cancelled
CPU tests Workflow / Testing (ubuntu-latest, 3.10) (push) Has been cancelled
CPU tests Workflow / testing-guardian (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 10:16:13 +00:00
parent 367934324e
commit a18c520c71
+51 -45
View File
@@ -1,4 +1,10 @@
# RF-DETR: Real-Time SOTA Object Detection, Instance Segmentation, and Keypoint Detection
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/roboflow/rf-detr) · [上游 README](https://github.com/roboflow/rf-detr/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
# RF-DETR:实时 SOTA 目标检测、实例分割与关键点检测
<div align="center">
@@ -22,28 +28,28 @@
---
RF-DETR is a real-time transformer architecture for object detection, instance segmentation, and keypoint detection (preview) developed by Roboflow. Built on a DINOv2 vision transformer backbone, RF-DETR delivers state-of-the-art accuracy and latency trade-offs on [Microsoft COCO](https://cocodataset.org/#home) and [RF100-VL](https://github.com/roboflow/rf100-vl).
RF-DETR 是 Roboflow 开发的面向目标检测、实例分割与关键点检测(预览版)的实时 Transformer 架构。基于 DINOv2 视觉 TransformerVision Transformer)骨干网络,RF-DETR 在 [Microsoft COCO](https://cocodataset.org/#home) [RF100-VL](https://github.com/roboflow/rf100-vl). 上实现了最先进的精度与延迟权衡。
RF-DETR uses a DINOv2 vision transformer backbone and supports object detection, instance segmentation, and keypoint detection (preview) in a single, consistent API. The open-source `rfdetr` package and Apache-designated models are released under Apache 2.0, while Plus components (`rfdetr_plus`, including RF-DETR-XL/2XL detection models) are licensed under PML 1.0.
RF-DETR 采用 DINOv2 视觉 Transformer 骨干网络,并通过统一、一致的 API 支持目标检测、实例分割与关键点检测(预览版)。开源的 `rfdetr` 包及 Apache 指定的模型以 Apache 2.0 发布,而 Plus 组件(`rfdetr_plus`,包括 RF-DETR-XL/2XL 检测模型)则采用 PML 1.0 许可。
The published RF-DETR sizes were created with neural architecture search (NAS) — and the same NAS method is now available on the [Roboflow platform](https://app.roboflow.com/), so you can discover the best architecture for your own dataset. Learn more in the [NAS docs](https://docs.roboflow.com/train/neural-architecture-search).
已发布的 RF-DETR 各规格均通过神经架构搜索(NAS,Neural Architecture Search)创建——同一 NAS 方法现已在 [Roboflow 平台](https://app.roboflow.com/), 提供,你可据此为自有数据集发现最佳架构。详见 [NAS 文档](https://docs.roboflow.com/train/neural-architecture-search).
https://github.com/user-attachments/assets/add23fd1-266f-4538-8809-d7dd5767e8e6
## Install
## 安装
To install RF-DETR, install the `rfdetr` package in a [**Python>=3.10**](https://www.python.org/) environment with `pip`.
要安装 RF-DETR,请在配备 `pip` [**Python>=3.10**](https://www.python.org/)) 环境中安装 `rfdetr` 包。
```bash
pip install rfdetr
```
<details>
<summary>Install from source</summary>
<summary>从源码安装</summary>
<br>
By installing RF-DETR from source, you can explore the most recent features and enhancements that have not yet been officially released. **Please note that these updates are still in development and may not be as stable as the latest published release.**
从源码安装 RF-DETR,可体验尚未正式发布的新功能与改进。**请注意,这些更新仍在开发中,稳定性可能不及最新正式发布版本。**
```bash
pip install https://github.com/roboflow/rf-detr/archive/refs/heads/develop.zip
@@ -51,20 +57,20 @@ pip install https://github.com/roboflow/rf-detr/archive/refs/heads/develop.zip
</details>
## Benchmarks
## 基准测试
RF-DETR achieves state-of-the-art results in both object detection and instance segmentation, with benchmarks reported on Microsoft COCO and RF100-VL (RF100-VL for detection only). The charts and tables below compare RF-DETR against other top real-time models across accuracy and latency for detection and segmentation. All latency numbers were measured on an NVIDIA T4 using TensorRT, FP16, and batch size 1. For full benchmarking methodology and reproducibility details, see [roboflow/sab](https://github.com/roboflow/single_artifact_benchmarking).
RF-DETR 在目标检测与实例分割上均达到最先进水平,基准测试结果报告于 Microsoft COCO RF100-VLRF100-VL 仅用于检测)。下图与下表将 RF-DETR 与其他顶尖实时模型在检测与分割的精度、延迟方面进行对比。所有延迟数据均在 NVIDIA T4 上测得,使用 TensorRTFP16,批大小为 1。完整基准测试方法与可复现性说明,请参阅 [roboflow/sab](https://github.com/roboflow/single_artifact_benchmarking).
### Detection
### 检测
<img alt="rf_detr_1-4_latency_accuracy_object_detection" src="https://storage.googleapis.com/com-roboflow-marketing/rf-detr/rf_detr_1-4_latency_accuracy_object_detection.png" />
<details>
<summary>See object detection benchmark numbers</summary>
<summary>查看目标检测基准数据</summary>
<br>
| Architecture | COCO AP<sub>50</sub> | COCO AP<sub>50:95</sub> | RF100VL AP<sub>50</sub> | RF100VL AP<sub>50:95</sub> | Latency (ms) | Params (M) | Resolution | License |
| 架构 | COCO AP<sub>50</sub> | COCO AP<sub>50:95</sub> | RF100VL AP<sub>50</sub> | RF100VL AP<sub>50:95</sub> | 延迟 (ms) | 参数量 (M) | 分辨率 | 许可证 |
| :-----------: | :------------------: | :---------------------: | :---------------------: | :------------------------: | :----------: | :--------: | :--------: | :--------: |
| RF-DETR-N | 67.6 | 48.4 | 85.0 | 57.7 | 2.3 | 30.5 | 384x384 | Apache 2.0 |
| RF-DETR-S | 72.1 | 53.0 | 86.7 | 60.2 | 3.5 | 32.1 | 512x512 | Apache 2.0 |
@@ -95,12 +101,12 @@ RF-DETR achieves state-of-the-art results in both object detection and instance
</details>
### Segmentation
### 实例分割(Segmentation
<img alt="rf_detr_1-4_latency_accuracy_instance_segmentation" src="https://storage.googleapis.com/com-roboflow-marketing/rf-detr/rf_detr_1-4_latency_accuracy_instance_segmentation.png" />
<details>
<summary>See instance segmentation benchmark numbers</summary>
<summary>查看实例分割基准测试数据</summary>
<br>
@@ -130,12 +136,12 @@ RF-DETR achieves state-of-the-art results in both object detection and instance
</details>
### Keypoints
### 关键点(Keypoints
<img alt="RF-DETR Keypoint mAP vs latency chart comparing against YOLO26-pose and YOLO11-pose on MS COCO" src="https://raw.githubusercontent.com/roboflow/rf-detr/develop/docs/assets/keypoints/kp-map-latency.png" />
<details>
<summary>See keypoint detection benchmark numbers</summary>
<summary>查看关键点检测基准测试数据</summary>
<br>
@@ -155,13 +161,13 @@ RF-DETR achieves state-of-the-art results in both object detection and instance
</details>
> Keypoint benchmarks report AP<sub>50:95</sub> (OKS-based); this is the standard COCO keypoint comparison metric.
> 关键点基准测试报告 AP<sub>50:95</sub>(基于 OKS);这是 COCO 关键点对比的标准指标。
## Run Models
## 运行模型
### Detection
### 检测
RF-DETR provides multiple model sizes, ranging from Nano to 2XLarge. To use a different model size, replace the class name in the code snippet below with another class from the table.
RF-DETR 提供多种模型尺寸,从 Nano 2XLarge。要使用其他模型尺寸,请将下方代码片段中的类名替换为表格中的其他类。
```python
import supervision as sv
@@ -178,14 +184,14 @@ annotated_image = sv.BoxAnnotator().annotate(detections.metadata["source_image"]
annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections, labels)
```
> **Note:** `COCO_CLASSES` works for COCO-pretrained models. For fine-tuned models, use `detections.data["class_name"]` instead — it resolves class names from the checkpoint and works for both COCO and custom datasets.
> **注意:** `COCO_CLASSES` 适用于 COCO 预训练模型。对于微调模型,请改用 `detections.data["class_name"]` —— 它会从 checkpoint 解析类名,并适用于 COCO 和自定义数据集。
<details>
<summary>Run RF-DETR with Inference</summary>
<summary>使用 Inference 运行 RF-DETR</summary>
<br>
You can also run RF-DETR models using the Inference library. To switch model size, select the appropriate inference package alias from the table below.
你也可以使用 Inference 库运行 RF-DETR 模型。要切换模型尺寸,请从下方表格中选择相应的 inference 包别名。
```python
import requests
@@ -214,11 +220,11 @@ annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections)
| XL | `RFDETRXLarge` △ | `rfdetr-xlarge` | 77.4 | 58.6 | 11.5 | 126.4 | 700x700 | PML 1.0 |
| 2XL | `RFDETR2XLarge` △ | `rfdetr-2xlarge` | 78.5 | 60.1 | 17.2 | 126.9 | 880x880 | PML 1.0 |
> Requires the `rfdetr_plus` extension: `pip install rfdetr[plus]`. See [License](#license) for details.
> 需要 `rfdetr_plus` 扩展:`pip install rfdetr[plus]`。详见 [许可证](#license)。
### Segmentation
### 实例分割(Segmentation
RF-DETR supports instance segmentation with model sizes from Nano to 2XLarge. To use a different model size, replace the class name in the code snippet below with another class from the table.
RF-DETR 支持实例分割,模型尺寸从 Nano 2XLarge。要使用其他模型尺寸,请将下方代码片段中的类名替换为表格中的其他类。
```python
import supervision as sv
@@ -236,11 +242,11 @@ annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections, labe
```
<details>
<summary>Run RF-DETR-Seg with Inference</summary>
<summary>使用 Inference 运行 RF-DETR-Seg</summary>
<br>
You can also run RF-DETR-Seg models using the Inference library. To switch model size, select the appropriate inference package alias from the table below.
你也可以使用 Inference 库运行 RF-DETR-Seg 模型。要切换模型尺寸,请从下表中选择相应的 inference 包别名。
```python
import requests
@@ -269,9 +275,9 @@ annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections)
| XL | `RFDETRSegXLarge` | `rfdetr-seg-xlarge` | 72.2 | 48.8 | 13.5 | 38.1 | 624x624 | Apache 2.0 |
| 2XL | `RFDETRSeg2XLarge` | `rfdetr-seg-2xlarge` | 73.1 | 49.9 | 21.8 | 38.6 | 768x768 | Apache 2.0 |
### Keypoints
### 关键点
RF-DETR supports keypoint detection (preview) with `RFDETRKeypointPreview`, pretrained on COCO person keypoints.
RF-DETR 支持关键点检测(预览版),使用 `RFDETRKeypointPreview`,在 COCO 人体关键点上预训练。
```python
from rfdetr import RFDETRKeypointPreview
@@ -284,30 +290,30 @@ key_points = model.predict("image.jpg", threshold=0.5)
| :----------------: | :---------------------: | :---------------------: | :----------: | :--------: | :--------: | :--------: |
| Keypoint (Preview) | `RFDETRKeypointPreview` | 71.8 | 9.7 | 126.4 | 576x576 | Apache 2.0 |
### Train Models
### 训练模型
RF-DETR supports training for object detection, instance segmentation, and keypoint detection (preview). You can train models in [Google Colab](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-finetune-rf-detr-on-detection-dataset.ipynb) or directly on the Roboflow platform. Below you will find a step-by-step video fine-tuning tutorial.
RF-DETR 支持目标检测、实例分割和关键点检测(预览版)的训练。你可以在 [Google Colab](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-finetune-rf-detr-on-detection-dataset.ipynb) 中训练模型,或直接在 Roboflow 平台上训练。下方提供了一段分步视频微调教程。
[![rf-detr-tutorial-banner](https://github.com/user-attachments/assets/555a45c3-96e8-4d8a-ad29-f23403c8edfd)](https://youtu.be/-OvpdLAElFA)
## Documentation
## 文档
Visit our [documentation website](https://rfdetr.roboflow.com) to learn more about how to use RF-DETR.
访问我们的[文档网站](https://rfdetr.roboflow.com),了解更多关于如何使用 RF-DETR 的信息。
## License
## 许可证
Licensing is split by component:
许可按组件划分:
- The open-source `rfdetr` package and Apache-designated model weights are licensed under Apache License 2.0. See [`LICENSE`](LICENSE).
- Plus components, including the `rfdetr_plus` extension and RF-DETR-XL / RF-DETR-2XL detection models, are licensed under PML 1.0.
- 开源的 `rfdetr` 包及 Apache 指定的模型权重采用 Apache License 2.0 许可。请参阅 [`LICENSE`](LICENSE)
- Plus 组件,包括 `rfdetr_plus` 扩展以及 RF-DETR-XL / RF-DETR-2XL 检测模型,采用 PML 1.0 许可。
## Acknowledgements
## 致谢
Our work is built upon [LW-DETR](https://arxiv.org/pdf/2406.03459), [DINOv2](https://arxiv.org/pdf/2304.07193), and [Deformable DETR](https://arxiv.org/pdf/2010.04159). Thanks to their authors for their excellent work!
我们的工作建立在 [LW-DETR](https://arxiv.org/pdf/2406.03459),[DINOv2](https://arxiv.org/pdf/2304.07193), [Deformable DETR](https://arxiv.org/pdf/2010.04159). 之上。感谢这些项目的作者出色的工作!
## Citation
## 引用
If you find our work helpful for your research, please consider citing the following BibTeX entry.
如果你觉得我们的工作对你的研究有帮助,请考虑引用以下 BibTeX 条目。
```bibtex
@inproceedings{robinson2026rfdetr,
@@ -319,9 +325,9 @@ If you find our work helpful for your research, please consider citing the follo
}
```
## Contribute
## 贡献
We welcome and appreciate all contributions! If you notice any issues or bugs, have questions, or would like to suggest new features, please [open an issue](https://github.com/roboflow/rf-detr/issues/new) or pull request. By sharing your ideas and improvements, you help make RF-DETR better for everyone.
我们欢迎并感谢所有贡献!如果你发现任何问题或 bug、有疑问,或想建议新功能,请[提交 issue](https://github.com/roboflow/rf-detr/issues/new) pull request。通过分享你的想法和改进,你正在帮助让 RF-DETR 变得更好。
<p align="center">
<a href="https://youtube.com/roboflow"><img src="https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652" width="3%"/></a>