YOLO26 object detection runs through the Serverless Cloud API, pretrained on COCO. For self-hosted deployment, see Roboflow Inference.
YOLO26 Object Detection API
This sample downloads a test image, runs inference through inference-sdk, decodes the response with supervision, and writes an annotated PNG to disk.
Get your API Key
Create a Roboflow account, find your key on the Roboflow API settings page and make it available to your shell:
export ROBOFLOW_API_KEY="your-key-here"Install the dependencies
Install the SDK and the supervision library for annotation:
pip install -U inference-sdk supervision opencv-pythonRun the model
Run yolo26n-640 on a sample image and annotate boxes and labels:
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image_url = "https://media.roboflow.com/quickstart/traffic.jpg"
image = sv.load_image_from_url(image_url)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="yolo26n-640")
detections = sv.Detections.from_inference(result)
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("traffic-annotated.png", annotated)
Set api_url to match your deployment target:
https://serverless.roboflow.comfor the Serverless Cloud API.http://localhost:9001for a local Inference server.- Your Dedicated Deployment URL for a private endpoint.
YOLO26 Object Detection models and benchmarks
Pass any of these aliases as the model_id. The inference-sdk resolves each alias to its pretrained Roboflow Universe model client-side; the yolov26* prefix variants resolve to the same models.
| Alias | Input Size | mAP50-95 | ONNX latency (ms) |
|---|
YOLO26 Instance Segmentation
YOLO26 instance segmentation runs through the Serverless Cloud API, pretrained on COCO. For self-hosted deployment, see Roboflow Inference.
YOLO26 Instance Segmentation API
Set your API key and install the dependencies as shown above, then run yolo26n-seg-640 and annotate masks and labels:
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image_url = "https://media.roboflow.com/quickstart/traffic.jpg"
image = sv.load_image_from_url(image_url)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="yolo26n-seg-640")
detections = sv.Detections.from_inference(result)
annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
annotated = sv.BoxAnnotator().annotate(annotated, detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("traffic-annotated.png", annotated)
YOLO26 Instance Segmentation models and benchmarks
Pass any of these aliases as the model_id; the yolov26* prefix variants resolve to the same models. Box and mask mAP are end-to-end (NMS-free) COCO val values.
| Alias | Input Size | Box mAP50-95 | Mask mAP50-95 | ONNX latency (ms) |
|---|
YOLO26 Keypoint Detection
YOLO26 keypoint/pose detection runs through the Serverless Cloud API, pretrained on COCO. For self-hosted deployment, see Roboflow Inference.
YOLO26 Keypoint Detection API
Set your API key and install the dependencies as shown above, then run yolo26n-pose-640 and annotate keypoints:
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image_url = "https://media.roboflow.com/notebooks/examples/person-walking.png"
image = sv.load_image_from_url(image_url)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="yolo26n-pose-640")
key_points = sv.KeyPoints.from_inference(result)
annotated = sv.VertexAnnotator(color=sv.Color.RED, radius=5).annotate(image.copy(), key_points)
cv2.imwrite("person-walking-annotated.png", annotated)
YOLO26 Keypoint Detection models and benchmarks
Pass any of these aliases as the model_id; the yolov26* prefix variants resolve to the same models. mAP is the end-to-end (NMS-free) COCO val value.
| Alias | Input Size | mAP50-95 | ONNX latency (ms) |
|---|
YOLO26 Semantic Segmentation
YOLO26 semantic segmentation (yolo26-sem) is the recommended architecture for semantic segmentation on Roboflow. It uses Cityscapes pretrained weights and trains at a default resolution of 1024x1024. Available in five sizes: n, s, m, l, x.
To train a YOLO26-SEM model, create a semantic segmentation Project and select YOLO26 as your architecture. You can also upload custom-trained weights for YOLO26-SEM models.
The Cityscapes pretrained models (19 classes) are also available as public models you can run in a Workflow without training.
YOLO26 Semantic Segmentation models and benchmarks
Pass any of these Cityscapes-pretrained aliases as the model_id; the yolov26* prefix variants resolve to the same models. They run on the ONNX backend only; no prebuilt TensorRT engine is published.
| Alias | Input Size | ONNX latency (ms)* |
|---|---|---|
yolo26n-sem-1024 | 1024x1024 | 23.3 |
yolo26s-sem-1024 | 1024x1024 | 25.9 |
yolo26m-sem-1024 | 1024x1024 | 34.6 |
yolo26l-sem-1024 | 1024x1024 | 35.8 |
yolo26x-sem-1024 | 1024x1024 | 53.2 |
* Latency is measured with Roboflow Inference on 1x NVIDIA L4, batch size 1, mean of 1,000 inferences (100 warmup). The default inference-gpu install runs ONNX on the CUDA execution provider; adding the inference-models[trt10] extra selects a prebuilt TensorRT FP16 engine automatically. FP16 matches FP32 accuracy within 0.1 mAP on COCO val2017. Accuracy is the published COCO val spec (source).