PaliGemma 2
Use Google's PaliGemma 2 vision-language model through our Serverless Cloud API
Code sample
3
Run the model
import 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(
image,
model_id="paligemma2-3b-pt-224",
prompt="caption en",
max_new_tokens=64,
)
print(result["response"])a dog is seen here on the shoulder of a man
Inference speed
Alias
Latency, 128 tokens (ms)
Tokens/sec
PaliGemma 1 (legacy)
Visual question answering
Object detection
Last updated
Was this helpful?