Florence 2
Microsoft의 Florence 2 멀티모달 모델을 Serverless Cloud API를 통해 사용하세요.
마지막 업데이트
도움이 되었나요?
도움이 되었나요?
export ROBOFLOW_API_KEY="your-key-here"curl --location 'https://serverless.roboflow.com/infer/lmm' \
--header 'Content-Type: application/json' \\
--data '{
"api_key": "'"$ROBOFLOW_API_KEY"'",
"image": {"type": "url", "value": "https://media.roboflow.com/quickstart/dog.jpeg"},
"model_id": "florence-2-base",
"prompt": "<CAPTION>"
}'export ROBOFLOW_API_KEY="your-key-here"pip install -U inference-sdk supervisionimport os
import supervision as sv
from inference_sdk import InferenceHTTPClient
image = sv.load_image_from_url("https://media.roboflow.com/quickstart/dog.jpeg")
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer_lmm(
inference_input=image,
model_id="florence-2-base",
prompt="<CAPTION>",
)
print(result["response"]) # {'<CAPTION>': '개를 등에 업고 있는 남자.'}pip install "inference[transformers]"from inference import get_model
model = get_model("florence-2-base", api_key="YOUR_API_KEY")
result = model.infer(
"https://media.roboflow.com/inference/seawithdock.jpeg",
prompt="<CAPTION>",
)
print(result[0].response)