ViT
Run ViT classification models trained on Roboflow via the 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/notebooks/examples/dog.jpeg")
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
# No pretrained aliases: train your own model and replace "your-project/1" with your model ID.
results = client.infer(image, model_id="your-project/1")
print(results)Last updated
Was this helpful?