Ultralytics YOLO26: train and run body segmentation
Learn to train a 19-class segmentation model in Ultralytics Platform, export PT weights, and use Python to track clothing and body parts on CPU.
Player not loading? Watch on YouTube
This tutorial covers a YOLO26 instance segmentation workflow for human body parts, clothing and accessories. It starts in Ultralytics Platform with a dataset described as containing over 30,000 images and 19 classes, including faces, hair, arms, pants and coats. The presenter reviews class distributions before selecting a nano segmentation model and setting training to 20 epochs.
The platform walkthrough covers GPU selection, training losses, precision, recall and mean average precision. After training, the presenter tests validation images and discusses whether further training is needed. He says the model probably has not fully converged, so the demonstrated results should not be treated as a finished accuracy benchmark.
The local AI portion begins with exporting a PT weights file and loading it into a custom Python application. The code accepts model, video and output paths, a confidence threshold and an optional processing preview. It reads frames, calls model.track, draws masks and detection labels, and writes an annotated video. The presenter also describes webcam input and demonstrates video processing on his CPU. This is a platform training and local inference tutorial; it does not demonstrate a complete local training setup.