> 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/yolo-world.md).

# YOLO-World

YOLO-World는 학습 없이 임의의 텍스트 클래스 이름으로부터 객체를 탐지하는 오픈 보캐뷸러리 객체 탐지 모델입니다. 우리는 우리의 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md).

YOLO-World 실행에 대한 자세한 내용은 [Inference 문서](https://inference.roboflow.com/).

## 코드 샘플

다음과 함께 HTTP 엔드포인트를 통해 직접 YOLO-World를 실행하세요 `curl`또는 [`inference-sdk`](https://inference.roboflow.com/inference_helpers/inference_sdk/) 래퍼를 사용하세요.

{% tabs %}
{% tab title="HTTP (curl)" icon="webhook" %}
{% stepper %}
{% step %}

### API Key를 받으세요

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

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

{% endstep %}

{% step %}

### 모델을 실행하세요

다음에 호출하세요. `/yolo_world/infer` 엔드포인트를 `curl`:

```bash
curl --location 'https://serverless.roboflow.com/yolo_world/infer' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "'"$ROBOFLOW_API_KEY"'",
    "image": {"type": "url", "value": "https://media.roboflow.com/quickstart/traffic.jpg"},
    "text": ["car", "truck"],
    "yolo_world_version_id": "v2-s",
    "confidence": 0.05
  }'
```

{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="SDK (Python)" icon="python" %}
{% stepper %}
{% step %}

### API Key를 받으세요

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

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

{% endstep %}

{% step %}

### 종속성을 설치하세요

SDK를 설치하고 [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}

### 모델을 실행하세요

커스텀 클래스 이름으로 YOLO-World를 실행한 다음, supervision으로 예측 결과를 디코딩하고 시각화합니다.

```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"],
)

results = client.infer_from_yolo_world(
    inference_input=image,
    class_names=["car", "truck"],
    model_version="v2-s",
    confidence=0.05,
)

detections = sv.Detections.from_inference(results[0])

labels = [
    f"{name} {conf:.2f}"
    for name, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections, labels=labels)
cv2.imwrite("annotated.png", annotated)
```

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

해당 `class_names` 인수는 어떤 클래스 이름 목록이든 허용합니다. 사용 가능한 `model_version` 값: `v2-s`, `v2-m`, `v2-l`, `v2-x`, `s`, `m`, `l`, `x`.

## 추론 속도

다음 기준으로 측정한 지연 시간 [Roboflow Inference](https://inference.roboflow.com/) 1x NVIDIA L4에서, 배치 크기 1로, 워밍업 이후 평균값입니다.

<table data-search="false"><thead><tr><th>모델</th><th>지연 시간(ms)</th></tr></thead><tbody><tr><td><code>yolo-world</code></td><td>12.4</td></tr></tbody></table>

다음에서 측정됨 `v2-s` 두 개 클래스가 있는 변형입니다. 클래스 목록을 설정하면 텍스트 인코더가 한 번 실행되며, 프레임마다 반복되지 않으므로 이 그림에서는 제외됩니다.

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