PaliGemma 2
Serverless Hosted API を通じて Google の PaliGemma 2 vision-language model を使用します
コードサンプル
3
モデルを実行する
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient
content = requests.get("https://media.roboflow.com/quickstart/dog.jpeg").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"],
)
result = client.infer_lmm(
image,
model_id="paligemma2-3b-pt-224",
prompt="caption en",
max_new_tokens=64,
)
print(result["response"])ここでは、男性の肩の上に犬が見えます
推論速度
別名
レイテンシ、128 トークン (ms)
トークン/秒
最終更新
役に立ちましたか?