> 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/florence-2.md).

# Florence 2

저희는 지원합니다 [Microsoft의 Florence 2](https://huggingface.co/microsoft/Florence-2-base), 멀티모달 비전-언어 모델을, 저희의 [Serverless Hosted API](/roboflow/roboflow-ko/deploy/serverless-hosted-api-v2.md). Florence 2는 다음과 같은 작업 프롬프트를 통해 캡셔닝, 객체 탐지, 세분화, OCR을 지원합니다( `<CAPTION>`, `<OD>`, `<OCR>`, `<REFERRING_EXPRESSION_SEGMENTATION>`).

## 기본 별칭

별칭을 `model_id` 로 사용하면 런타임이 이를 해당하는 사전 학습된 가중치로 해석합니다.

| 별칭                 |
| ------------------ |
| `florence-2-base`  |
| `florence-2-large` |

## 코드 샘플

Florence 2는 공통 `/infer/lmm` 엔드포인트를 통해 실행됩니다. 다음으로 직접 호출하세요 `curl`:

```bash
curl --location 'https://serverless.roboflow.com/infer/lmm' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "YOUR_API_KEY",
    "image": {"type": "url", "value": "https://media.roboflow.com/notebooks/examples/dog.jpeg"},
    "model_id": "florence-2-base",
    "prompt": "<CAPTION>"
  }'
```

SDK를 통해 동일한 호출을 수행합니다. 이를 설치하고 작업 프롬프트와 함께 LMM 추론 엔드포인트를 호출하세요. 다음을 전달하세요: [Roboflow API Key](https://app.roboflow.com/settings/api) 를 `API_KEY` 환경 변수.

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

```python
import os
import urllib.request
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/notebooks/examples/dog.jpeg"
image_path = "dog.jpeg"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)

result = client.infer_lmm(
    inference_input=image_path,
    model_id="florence-2-base",
    prompt="<CAPTION>",
)

print(result["response"])  # {'<CAPTION>': '개를 등에 업고 있는 남자.'}
```

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

바꾸기 `<CAPTION>` 을 지원되는 작업 프롬프트로 자유롭게 (예를 들어 `<DETAILED_CAPTION>`, `<OD>`, `<OCR>`, `<OPEN_VOCABULARY_DETECTION>`, `<REFERRING_EXPRESSION_SEGMENTATION>`)을 사용하여 캡셔닝, 탐지, OCR 및 세분화 작업 간에 전환하세요.

자가 호스팅 배포 및 작업 프롬프트의 전체 목록은 다음을 참조하세요. [Inference 문서](https://inference.roboflow.com/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-ko/deploy/supported-models/florence-2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
