Ultralytics YOLO26: train segmentation and run locally

Learn to train YOLO26 semantic segmentation on 100 wooden-tool images, export a PyTorch model, and run video inference locally in Python.

Player not loading? Watch on YouTube

This tutorial follows a YOLO26 semantic segmentation workflow in Ultralytics Platform, then moves the trained model into a local Python script. The speaker explains how semantic segmentation assigns pixel classes, while instance segmentation separates individual objects with masks and bounding boxes.

The wooden-tools dataset contains 100 images with three classes: skewer, beveler, and burnisher. The training example uses the YOLO26 nano semantic model for 50 epochs with the default batch size. The speaker distinguishes the semantic model's -sem suffix from -seg for instance segmentation and says nano through extra-large variants support the task. Training runs on hardware selected within the platform; this portion does not demonstrate training on the viewer's own machine.

After training, the tutorial examines losses, pixel accuracy, and mean intersection over union, then tests an uploaded image. The speaker notes that the result is imperfect and suggests more training and a larger dataset for a practical system.

For local AI inference, the workflow downloads the PyTorch model and runs predictions on a tools video through a Python script. The speaker reports roughly 15 ms on their CPU, but does not identify the CPU, so this is a demonstration result rather than a general performance guarantee. A separate pretrained street-scene example illustrates pixel labels for roads, trees, buildings, and cars.