Skip to content

Commit 84ac5f0

Browse files
leeclemnetclaudePawelPeczek-Roboflow
authored
docs(inference_models): add YOLO26 semantic segmentation model page (#2419)
Document the YOLO26 semantic-segmentation variant alongside the existing yolo26 (object-detection / instance-segmentation / keypoint) pages: a new models/yolo26-semantic-segmentation.md (license, public Cityscapes yolo26{n,s,m,l,x}-sem-1024 checkpoints, onnx/torch-script/trt backends, SemanticSegmentationResult output, usage example), plus nav + model-index entries under Semantic Segmentation next to DeepLabV3+. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Paweł Pęczek <146137186+PawelPeczek-Roboflow@users.noreply.github.com>
1 parent 536c8e4 commit 84ac5f0

3 files changed

Lines changed: 105 additions & 0 deletions

File tree

inference_models/docs/models/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The `inference-models` library supports a wide range of computer vision models a
6666

6767
| Model | Backends | License | Commercial License in RF Plan | Pre-trained Weights | Trainable at RF |
6868
|-------|----------|---------|-------------------------------|---------------------|-----------------|
69+
| [YOLO26 Sem](yolo26-semantic-segmentation.md) | `onnx`, `torch-script`, `trt` | AGPL-3.0 ||||
6970
| [DeepLabV3+](deeplabv3plus.md) | `torch`, `onnx`, `trt` | MIT | N/A |||
7071

7172
### OCR & Document Parsing
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# YOLO26 - Semantic Segmentation
2+
3+
YOLO26 is the latest addition to the Ultralytics YOLO model series. The semantic segmentation variant assigns a class label to every pixel in an image, producing dense scene-level masks rather than per-object instances.
4+
5+
## Overview
6+
7+
YOLO26 for semantic segmentation pairs the efficient YOLO26 backbone with a dense per-pixel prediction head. Key features include:
8+
9+
- **Per-pixel classification** - Every pixel is assigned a single class label.
10+
- **Efficient YOLO26 backbone** - Shares the NMS-free, DFL-free YOLO26 architecture for fast inference and broad edge compatibility.
11+
- **Cityscapes pre-trained checkpoints** - Public weights trained on the 19-class Cityscapes dataset, available across all model sizes.
12+
- **Binary and multi-class** - Supports a single foreground class (binary head) or many foreground classes, alongside an implicit background.
13+
- **Multiple model sizes** - From nano to extra-large variants.
14+
15+
## License
16+
17+
**AGPL-3.0**
18+
19+
!!! info "Commercial Licensing"
20+
- **AGPL-3.0**: Free for open-source projects. Requires derivative works to be open-sourced.
21+
- **Paid Roboflow customers**: Automatically get access to use any YOLO26 models trained on or uploaded to the Roboflow platform for commercial use.
22+
- **Free Roboflow customers**: Can use YOLO26 via the serverless hosted API, or commercially self-hosted with a paid plan.
23+
24+
Learn more: [Roboflow Licensing](https://roboflow.com/licensing) | [YOLO26 License Details](https://roboflow.com/model-licenses/yolo26)
25+
26+
## Pre-trained Model IDs
27+
28+
Public YOLO26 semantic segmentation checkpoints are trained on the **Cityscapes** dataset (19 classes) at 1024×1024 and are **open access** (no API key required).
29+
30+
| Model Size | 1024×1024 |
31+
|------------|-----------|
32+
| Nano | `yolo26n-sem-1024` |
33+
| Small | `yolo26s-sem-1024` |
34+
| Medium | `yolo26m-sem-1024` |
35+
| Large | `yolo26l-sem-1024` |
36+
| Extra-Large | `yolo26x-sem-1024` |
37+
38+
**Custom model ID format:** `project-url/version` (e.g., `my-project-abc123/2`)
39+
40+
## Supported Backends
41+
42+
| Backend | Extras Required |
43+
|---------|----------------|
44+
| `onnx` | `onnx-cpu`, `onnx-cu12`, `onnx-cu118`, `onnx-jp6-cu126` |
45+
| `torch-script` | `torch-cpu`, `torch-cu118`, `torch-cu124`, `torch-cu126`, `torch-cu128`, `torch-jp6-cu126` |
46+
| `trt` | `trt10` |
47+
48+
## Roboflow Platform Compatibility
49+
50+
| Feature | Supported |
51+
|---------|-----------|
52+
| **Training** | ✅ Train custom models on Roboflow |
53+
| **Upload Weights** | ✅ Upload pre-trained weights |
54+
| **Serverless API (v2)** |[Deploy via hosted API](https://docs.roboflow.com/deploy/serverless-hosted-api-v2) |
55+
| **Edge Deployment (Jetson)** | ✅ Deploy on NVIDIA Jetson devices |
56+
| **Self-Hosting** | ✅ Deploy with `inference-models` |
57+
58+
## Usage Example
59+
60+
```python
61+
import cv2
62+
import numpy as np
63+
from inference_models import AutoModel
64+
65+
# Load a public Cityscapes checkpoint (open access, no API key required)
66+
model = AutoModel.from_pretrained("yolo26n-sem-1024")
67+
image = cv2.imread("path/to/image.jpg")
68+
69+
# Run inference
70+
results = model(image)
71+
72+
# Per-pixel class IDs and confidence
73+
seg_map = results[0].segmentation_map # (H x W) class id per pixel
74+
confidence = results[0].confidence # (H x W) per-pixel confidence
75+
76+
# Colour the mask and overlay on the original image
77+
colors = np.random.randint(0, 255, size=(len(model.class_names), 3), dtype=np.uint8)
78+
colored_mask = colors[seg_map.cpu().numpy()]
79+
overlay = cv2.addWeighted(image, 0.5, colored_mask, 0.5, 0)
80+
cv2.imwrite("segmentation_result.jpg", overlay)
81+
```
82+
83+
To run a custom-trained model, pass your `project-url/version` and a Roboflow API key:
84+
85+
```python
86+
model = AutoModel.from_pretrained(
87+
"my-project-abc123/2",
88+
api_key="your_roboflow_api_key",
89+
)
90+
```
91+
92+
## Output Format
93+
94+
The model returns a list of `SemanticSegmentationResult` objects with:
95+
96+
| Field | Type | Description |
97+
|-------|------|-------------|
98+
| `segmentation_map` | `torch.Tensor` | Class ID for each pixel (H x W) |
99+
| `confidence` | `torch.Tensor` | Confidence score for each pixel (H x W) |
100+
| `image_metadata` | `dict` | Optional metadata about the image |
101+
102+
!!! note "Semantic vs Instance Segmentation"
103+
Semantic segmentation labels every pixel with a class but does not separate individual objects (all cars share the "car" label). For per-object masks, counting, or tracking, use an instance segmentation model such as [YOLO26 - Instance Segmentation](yolo26-instance-segmentation.md).

inference_models/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ nav:
8585
- CLIP: models/clip.md
8686
- Perception Encoder: models/perception-encoder.md
8787
- Semantic Segmentation:
88+
- YOLO26: models/yolo26-semantic-segmentation.md
8889
- DeepLabV3+: models/deeplabv3plus.md
8990
- Open-Vocabulary Object Detection:
9091
- Grounding DINO: models/grounding-dino.md

0 commit comments

Comments
 (0)