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

# Roboflow 3.0

## Roboflow 3.0 객체 탐지

Roboflow 3.0은 Roboflow의 자체 모델 아키텍처입니다. Roboflow 플랫폼에서 Roboflow 3.0 모델을 학습하고 다음을 통해 배포합니다 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md). 아래 예시는 Roboflow의 공개 [COCO 모델](https://universe.roboflow.com/microsoft/coco) (`coco/3`) 따라서 바로 사용해 볼 수 있습니다. 자체 호스팅 배포는 다음을 참조하세요 [Roboflow Inference](https://inference.roboflow.com/).

### 코드 샘플

{% stepper %}
{% step %}
**API Key를 받으세요**

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

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

{% endstep %}

{% step %}
**종속성을 설치하세요**

다음을 설치하세요 [Inference SDK](https://inference.roboflow.com/) 및 [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}
**모델을 실행하세요**

샘플 이미지에서 탐지를 실행하고 박스와 레이블을 주석 처리합니다:

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
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/2ff996d8c5408ffe773e3272523d1a8ae22fccd6" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% 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 %}

## Roboflow 3.0 인스턴스 세분화

Roboflow 3.0 인스턴스 세분화 모델을 학습한 다음, 다음을 교체하세요 `your-project/1` 자신의 것으로 `{workspace}/{model-slug}` ID로 호출할 수 있습니다(참조 [Versions, Trainings, and Models](/roboflow/roboflow-ko/train/versions-trainings-and-models.md)). 위에 표시된 대로 API 키를 설정하고 종속성을 설치하세요.

### 코드 샘플

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

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 키를 설정하고 종속성을 설치하세요.

### 코드 샘플

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/docs/hand.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

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/79af452e44c0f17aaf727dd18d9a8e26d6c610ac" alt=""><figcaption></figcaption></figure>

## Roboflow 3.0 분류

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

### 코드 샘플

```python
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

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})")
```
