> 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).

# 로보플로우 3.0 객체 탐지

## 로보플로우 3.0 객체 탐지

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

### 코드 샘플

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

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"],
)
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` Serverless Hosted 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 %}

## 로보플로우 3.0 인스턴스 분할

로보플로우 3.0 인스턴스 분할 모델을 학습한 다음, 교체하세요 `your-project/1` 자신의 것으로 `{workspace}/{model-slug}` ID (참조 [버전, 학습, 및 모델](/models/ko/versions-trainings-and-models.md)). 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)
```

## 로보플로우 3.0 키포인트 탐지

이 예시는 공개 [rf-handpose](https://universe.roboflow.com/erik-pe6au/rf-handpose) 손 키포인트 모델을 사용한 다음 21개 포인트의 손 스켈레톤을 그립니다. 자신의 것으로 바꾸세요 `{workspace}/{model-slug}`. 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>

## 로보플로우 3.0 분류

분류 응답에는 신뢰도와 함께 클래스 예측 목록이 포함되므로 시각화는 적용되지 않습니다. 응답에서 상위 클래스를 직접 읽어오세요. 다음으로 바꾸세요 `your-project/1` 학습한 모델 ID로, 그리고 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})")
```
