> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deploy/supported-models/yolo26.md).

# YOLO26

## YOLO26 Object Detection

YOLO26 object detection runs through the [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md), pretrained on COCO. For self-hosted deployment, see [Roboflow Inference](https://inference.roboflow.com/).

### Code sample

This sample downloads a test image, runs inference through `inference-sdk`, decodes the response with `supervision`, and writes an annotated PNG to disk.

{% stepper %}
{% step %}
**Get your API Key**

Create a Roboflow account, find your key on the [Roboflow API settings page](https://app.roboflow.com/settings/api) and make it available to your shell:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}
**Install the dependencies**

Install the SDK and the [supervision](https://supervision.roboflow.com/) library for annotation:

```bash
pip install inference-sdk supervision opencv-python
```

{% endstep %}

{% step %}
**Run the model**

Run `yolo26n-640` on a sample image and annotate boxes and labels:

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/quickstart/traffic.jpg"
content = requests.get(image_url).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(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)
```

<figure><img src="/files/QKdkDGTtoC39Ig3VKH24" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Set `api_url` to match your deployment target:

* `https://serverless.roboflow.com` for the Serverless Hosted API.
* `http://localhost:9001` for a local [Inference](https://inference.roboflow.com/) server.
* Your [Dedicated Deployment](/deploy/dedicated-deployments.md) URL for a private endpoint.
  {% endhint %}

### Pretrained 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.

<table data-search="false"><thead><tr><th>Alias</th><th>Input Size</th><th>mAP50-95</th><th>ONNX latency (ms)*</th><th>TensorRT FP16 (ms)*</th></tr></thead><tbody><tr><td><code>yolo26n-640</code></td><td>640x640</td><td>40.9</td><td>3.5</td><td>2.2</td></tr><tr><td><code>yolo26s-640</code></td><td>640x640</td><td>48.6</td><td>4.7</td><td>3.0</td></tr><tr><td><code>yolo26m-640</code></td><td>640x640</td><td>53.1</td><td>8.4</td><td>4.4</td></tr><tr><td><code>yolo26l-640</code></td><td>640x640</td><td>55.0</td><td>10.7</td><td>5.6</td></tr><tr><td><code>yolo26x-640</code></td><td>640x640</td><td>57.5</td><td>18.4</td><td>8.0</td></tr></tbody></table>

## YOLO26 Instance Segmentation

YOLO26 instance segmentation runs through the [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md), pretrained on COCO. For self-hosted deployment, see [Roboflow Inference](https://inference.roboflow.com/).

### Code sample

Set your API key and install the dependencies as shown above, then run `yolo26n-seg-640` and annotate masks and labels:

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/quickstart/traffic.jpg"
content = requests.get(image_url).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(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)
```

<figure><img src="/files/CL1yVLKzoqElWZQSKgjV" alt=""><figcaption></figcaption></figure>

### Pretrained 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.

<table data-search="false"><thead><tr><th>Alias</th><th>Input Size</th><th>Box mAP50-95</th><th>Mask mAP50-95</th><th>ONNX latency (ms)*</th><th>TensorRT FP16 (ms)*</th></tr></thead><tbody><tr><td><code>yolo26n-seg-640</code></td><td>640x640</td><td>39.6</td><td>33.9</td><td>8.3</td><td>6.8</td></tr><tr><td><code>yolo26s-seg-640</code></td><td>640x640</td><td>47.3</td><td>40.0</td><td>10.8</td><td>8.5</td></tr><tr><td><code>yolo26m-seg-640</code></td><td>640x640</td><td>52.5</td><td>44.1</td><td>16.4</td><td>11.9</td></tr><tr><td><code>yolo26l-seg-640</code></td><td>640x640</td><td>54.4</td><td>45.5</td><td>18.4</td><td>12.8</td></tr><tr><td><code>yolo26x-seg-640</code></td><td>640x640</td><td>56.5</td><td>47.0</td><td>28.9</td><td>15.7</td></tr></tbody></table>

## YOLO26 Keypoint Detection

YOLO26 keypoint/pose detection runs through the [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md), pretrained on COCO. For self-hosted deployment, see [Roboflow Inference](https://inference.roboflow.com/).

### Code sample

Set your API key and install the dependencies as shown above, then run `yolo26n-pose-640` and annotate keypoints:

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/notebooks/examples/person-walking.png"
content = requests.get(image_url).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(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)
```

<figure><img src="/files/vJrvqemcqmQKWkttl45J" alt=""><figcaption></figcaption></figure>

### Pretrained 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.

<table data-search="false"><thead><tr><th>Alias</th><th>Input Size</th><th>mAP50-95</th><th>ONNX latency (ms)*</th><th>TensorRT FP16 (ms)*</th></tr></thead><tbody><tr><td><code>yolo26n-pose-640</code></td><td>640x640</td><td>57.2</td><td>3.8</td><td>2.3</td></tr><tr><td><code>yolo26s-pose-640</code></td><td>640x640</td><td>63.0</td><td>5.1</td><td>3.3</td></tr><tr><td><code>yolo26m-pose-640</code></td><td>640x640</td><td>68.8</td><td>9.0</td><td>4.6</td></tr><tr><td><code>yolo26l-pose-640</code></td><td>640x640</td><td>70.4</td><td>11.2</td><td>5.8</td></tr><tr><td><code>yolo26x-pose-640</code></td><td>640x640</td><td>71.6</td><td>19.1</td><td>8.3</td></tr></tbody></table>

## 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](/deploy/upload-custom-weights.md) for YOLO26-SEM models.

The Cityscapes pretrained models (19 classes) are also available as public models you can run in a [Workflow](/workflows/what-is-workflows.md) without training.

### Pretrained 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.

<table data-search="false"><thead><tr><th>Alias</th><th>Input Size</th><th>ONNX latency (ms)*</th></tr></thead><tbody><tr><td><code>yolo26n-sem-1024</code></td><td>1024x1024</td><td>23.3</td></tr><tr><td><code>yolo26s-sem-1024</code></td><td>1024x1024</td><td>25.9</td></tr><tr><td><code>yolo26m-sem-1024</code></td><td>1024x1024</td><td>34.6</td></tr><tr><td><code>yolo26l-sem-1024</code></td><td>1024x1024</td><td>35.8</td></tr><tr><td><code>yolo26x-sem-1024</code></td><td>1024x1024</td><td>53.2</td></tr></tbody></table>

***

\* Latency is measured with [Roboflow Inference](https://inference.roboflow.com/) 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](https://docs.ultralytics.com/models/yolo26/)).
