> 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/models/ko/supported-models/roboflow-3.md).

# Roboflow 3.0

## Roboflow 3.0 객체 탐지

Roboflow 3.0은 Roboflow의 자체 모델 아키텍처입니다. Roboflow 플랫폼에서 Roboflow 3.0 모델을 학습하고, 다음을 통해 배포합니다 [서버리스 클라우드 API](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api). 아래 예시는 Roboflow의 공개 [COCO 모델](https://universe.roboflow.com/microsoft/coco) (`coco/3`)이므로 바로 시도해 볼 수 있습니다. 자체 호스팅 배포는 다음을 참조하세요 [Roboflow Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted).

### Roboflow 3.0 객체 탐지 API

{% stepper %}
{% step %}
**API 키 받기**

Roboflow 계정을 만들고, [Roboflow API 설정 페이지](https://app.roboflow.com/settings/api) 에서 키를 찾아 셸에서 사용할 수 있게 하세요:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}
**의존성을 설치하세요**

설치하세요 [Inference SDK](https://docs.roboflow.com/deployment/self-hosted/self-hosted) 및 [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}
**모델 실행**

샘플 이미지에서 탐지를 실행하고 박스와 라벨에 주석을 추가합니다:

```python
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

image = sv.load_image_from_url("https://media.roboflow.com/quickstart/traffic.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
).configure(InferenceConfiguration(api_key_transport="header"))
result = client.infer(image, model_id="coco/3")

detections = sv.Detections.from_inference(result)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)
```

<figure><img src="/files/fbabd615b696c0a0868a277abc9b53b01419e120" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

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

* `https://serverless.roboflow.com` 는 서버리스 클라우드 API용입니다.
* `http://localhost:9001` 로컬 [Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted) 서버용입니다.
* 귀하의 [전용 배포](https://docs.roboflow.com/deployment/roboflow-cloud/dedicated-deployments) 는 비공개 엔드포인트의 URL입니다.
  {% endhint %}

## Roboflow 3.0 인스턴스 세그멘테이션

Roboflow 3.0 인스턴스 세그멘테이션 모델을 학습한 다음, 다음을 교체하세요 `your-project/1` 을 자신의 `{workspace}/{model-slug}` ID(참조 [버전, 학습, 모델](/models/ko/versions-trainings-and-models.md)). API 키를 설정하고 위와 같이 종속성을 설치하세요.

### Roboflow 3.0 인스턴스 세그멘테이션 API

```python
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/quickstart/traffic.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
# 사전 학습된 별칭 없음: 직접 모델을 학습하고 "your-project/1"을 모델 ID로 바꾸세요.
result = client.infer(image, model_id="your-project/1")

detections = sv.Detections.from_inference(result)

annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)
```

## Roboflow 3.0 키포인트 탐지

이 예제는 공개 [rf-handpose](https://universe.roboflow.com/erik-pe6au/rf-handpose) 손 키포인트 모델을 사용한 뒤, 21개 포인트의 손 스켈레톤을 그립니다. 자신의 모델로 바꾸세요 `{workspace}/{model-slug}`. API 키를 설정하고 위와 같이 종속성을 설치하세요.

### Roboflow 3.0 키포인트 탐지 API

```python
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/docs/hand.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="rf-handpose/1")

key_points = sv.KeyPoints.from_inference(result)

# 손 스켈레톤: 손목 (0), 엄지 (1-4), 검지 (5-8), 중지 (9-12), 약지 (13-16), 새끼손가락 (17-20)
hand_edges = [
    (0, 1), (1, 2), (2, 3), (3, 4),
    (0, 5), (5, 6), (6, 7), (7, 8),
    (5, 9), (9, 10), (10, 11), (11, 12),
    (9, 13), (13, 14), (14, 15), (15, 16),
    (13, 17), (17, 18), (18, 19), (19, 20), (0, 17),
]
annotated = image.copy()
vertices = key_points.xy[0].astype(int)
for start, end in hand_edges:
    cv2.line(annotated, tuple(vertices[start]), tuple(vertices[end]), (255, 0, 0), 2)
annotated = sv.VertexAnnotator(color=sv.Color.GREEN, radius=5).annotate(annotated, key_points)
cv2.imwrite("output.png", annotated)
```

<figure><img src="/files/75373bd47b894a8dbd71df486f6ca58a448cf8d7" alt=""><figcaption></figcaption></figure>

## Roboflow 3.0 분류

분류 응답에는 신뢰도와 함께 클래스 예측 목록이 포함되므로 시각화는 적용되지 않습니다. 응답에서 최상위 클래스를 직접 읽으세요. 다음을 교체하세요 `your-project/1` 을 학습된 모델 ID로 바꾸고, API 키를 설정한 다음 위와 같이 종속성을 설치하세요.

### Roboflow 3.0 분류 API

```python
import os
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/quickstart/traffic.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
# 사전 학습된 별칭 없음: 직접 모델을 학습하고 "your-project/1"을 모델 ID로 바꾸세요.
result = client.infer(image, model_id="your-project/1")

print(f"Top class: {result['top']} ({result['confidence']:.4f})")
```
