> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-ko/deploy/supported-models/rf-detr.md).

# RF-DETR

RF-DETR은 Roboflow의 transformer 기반 실시간 객체 탐지, segmentation, keypoint detection 모델입니다. COCO로 사전 학습된 RF-DETR 체크포인트에 대해 추론을 수행하려면 다음을 통해 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md), 또는 다음을 사용해 자체 호스팅 [Roboflow Inference](https://inference.roboflow.com/).

## 코드 샘플

아래 예제는 RF-DETR을 다음을 통해 실행합니다 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md) 그리고 결과를 다음으로 시각화합니다 [supervision](https://supervision.roboflow.com/). 전달하세요 [Roboflow의 API Key](https://app.roboflow.com/settings/api) 를 `API_KEY` 환경 변수를 통해.

### 객체 탐지

```bash
pip install inference-sdk supervision
```

```python
import os
import urllib.request

import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/cars-highway.png"
image_path = "cars-highway.png"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)
result = client.infer(image_path, model_id="rfdetr-base")

image = cv2.imread(image_path)
detections = sv.Detections.from_inference(result)

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

annotated = box_annotator.annotate(scene=image.copy(), detections=detections)
annotated = label_annotator.annotate(scene=annotated, detections=detections)

cv2.imwrite("cars-highway-annotated.png", annotated)
```

<figure><img src="/files/239c9dfcee05cce618ecdf2628a3bf93261c6911" alt=""><figcaption></figcaption></figure>

### 인스턴스 분할

```bash
pip install inference-sdk supervision
```

```python
import os
import urllib.request

import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/bicycle.png"
image_path = "bicycle.png"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)
result = client.infer(image_path, model_id="rfdetr-seg-preview")

image = cv2.imread(image_path)
detections = sv.Detections.from_inference(result)

mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator()

annotated = mask_annotator.annotate(scene=image.copy(), detections=detections)
annotated = label_annotator.annotate(scene=annotated, detections=detections)

cv2.imwrite("bicycle-annotated.png", annotated)
```

<figure><img src="/files/b58691840a6a1da1912ed8f990b16415ce06f346" alt=""><figcaption></figcaption></figure>

## 기본 COCO 학습 모델

다음 별칭 중 하나를 전달하세요 `model_id` 추론을 실행할 때. SDK는 각 별칭을 해당하는 Roboflow 프로젝트 버전으로 해석합니다. 입력 해상도는 변형에 따라 다릅니다.

| 별칭                 | 작업      | 입력 크기   |
| ------------------ | ------- | ------- |
| rfdetr-base        | 객체 감지   | 560x560 |
| rfdetr-nano        | 객체 감지   | 384x384 |
| rfdetr-small       | 객체 감지   | 512x512 |
| rfdetr-medium      | 객체 감지   | 576x576 |
| rfdetr-large       | 객체 감지   | 704x704 |
| rfdetr-xlarge      | 객체 감지   | 700x700 |
| rfdetr-2xlarge     | 객체 감지   | 880x880 |
| rfdetr-seg-preview | 인스턴스 분할 | 560x560 |
| rfdetr-seg-nano    | 인스턴스 분할 | 312x312 |
| rfdetr-seg-small   | 인스턴스 분할 | 384x384 |
| rfdetr-seg-medium  | 인스턴스 분할 | 432x432 |
| rfdetr-seg-large   | 인스턴스 분할 | 504x504 |
| rfdetr-seg-xlarge  | 인스턴스 분할 | 624x624 |
| rfdetr-seg-2xlarge | 인스턴스 분할 | 768x768 |

{% hint style="info" %}
설정하세요 `api_url` 를 배포 대상에 맞게:

* `https://serverless.roboflow.com` Serverless Hosted API용.
* `http://localhost:9001` 로컬 [Inference](https://inference.roboflow.com/) 서버용.
* 귀하의 [Dedicated Deployment](/roboflow/roboflow-ko/deploy/dedicated-deployments.md) 개인 엔드포인트용 URL.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-ko/deploy/supported-models/rf-detr.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
