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

# Roboflow Instant

Roboflow Instant는 소수의 샘플로 학습하는 few-shot 객체 탐지 모델로, 소량의 라벨링된 이미지로 몇 분 만에 학습됩니다. 이 모델은 빠른 Proof of Concept 작업을 위해 설계되었으며 Object Detection 프로젝트만 지원합니다. 학습 방법은 [Roboflow Instant](/roboflow/roboflow-ko/train/roboflow-instant.md).

학습이 완료되면, Instant 모델은 다음에서 사용할 수 있습니다 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md) 다른 Roboflow 모델과 동일한 endpoint 패턴을 사용합니다.

## 사용 방법

Roboflow Instant 모델은 모델별 `{workspace}/{model-slug}` ID로 호출할 수 있습니다(참조 [Versions, Trainings, and Models](/roboflow/roboflow-ko/train/versions-trainings-and-models.md))을 사용해 호출하며, Roboflow 3.0 모델을 호출하는 방식과 동일합니다.

{% hint style="info" %}
Instant 모델의 confidence threshold는 민감할 수 있습니다. 최적값은 보통 학습 세트의 크기에 따라 0.85에서 0.99 사이입니다.
{% endhint %}

## 코드 샘플

{% 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/inference_helpers/inference_sdk/) 및 [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}

### 모델을 실행하세요

이 예시는 공개 [rf-bolts](https://universe.roboflow.com/erik-pe6au/rf-bolts) 소규모 라벨링 데이터셋으로 few-shot 학습된 Roboflow Instant 모델(screw, flat-washer, hex-nut)입니다. 여기에 자신의 `{workspace}/{model-slug}` 학습한 Instant 모델에 맞게 사용하세요.

```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/bolts.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(image, model_id="erik-pe6au/bolts-uzqzc-instant-1")

detections = sv.Detections.from_inference(results)

annotated_image = sv.BoxAnnotator().annotate(image.copy(), detections)

cv2.imwrite("annotated.png", annotated_image)
```

<figure><img src="/files/84413967a9671b2458c7e7299a3e1a46b2c8fdd6" 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 %}

더 많은 배포 옵션과 self-hosting에 대해서는 다음을 참조하세요 [Inference 문서](https://inference.roboflow.com/).
