YOLO26
Use the YOLO26 model family through our Serverless Hosted API
Code samples
pip install inference-sdk supervision opencv-pythonObject detection
import os
import urllib.request
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/cars-highway.png"
image_path = "cars-highway.png"
urllib.request.urlretrieve(image_url, image_path)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.getenv("API_KEY"),
)
result = client.infer(image_path, model_id="yolo26n-640")
detections = sv.Detections.from_inference(result)
image = cv2.imread(image_path)
labels = [
f"{cls} {conf:.2f}"
for cls, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(scene=image.copy(), detections=detections)
annotated = sv.LabelAnnotator().annotate(
scene=annotated, detections=detections, labels=labels
)
cv2.imwrite("cars-highway-annotated.png", annotated)
Instance segmentation

Keypoint detection

Default COCO aliases
Task
Alias
Last updated
Was this helpful?