YOLO26n-seg · Fashionpedia
Clothing instance segmentation · 10% of the Fashionpedia training split · 512 px training input
This checkpoint was fine-tuned for clothing instance segmentation as part of the FashionSwap AI lab project. Given a photograph, it predicts a class, confidence score, bounding box, and pixel mask for each detected clothing item. The masks can be used to select a garment for local image editing.
Validation preview
| Ground-truth annotations | Model predictions |
|---|---|
![]() | ![]() |
Both panels use the same validation images. Additional examples appear in the validation gallery.
Model details
| Item | Value |
|---|---|
| Architecture | Ultralytics YOLO26n-seg |
| Task | Clothing instance segmentation |
| Training data | 10% of the Fashionpedia training split |
| Training image size | imgsz=512 |
| Inference checkpoint | best.pt |
| Training configuration | args.yaml |
| Epoch-level metrics | results.csv |
The checkpoint stores its class IDs and names. Use model.names to inspect the exact mapping before filtering predictions by category.
Quick start
Install the dependencies:
pip install ultralytics huggingface-hub
Download the checkpoint and run inference on a local photo. Replace YOUR_USERNAME/YOUR_MODEL_REPO with this repository's ID and person.jpg with your image path.
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download(repo_id="YOUR_USERNAME/YOUR_MODEL_REPO", filename="best.pt")
model = YOLO(weights)
print("Classes:", model.names)
result = model.predict(
source="person.jpg",
device="cpu",
imgsz=512,
conf=0.25,
retina_masks=True,
verbose=False,
)[0]
result.save(filename="prediction.jpg")
if result.masks is not None:
for class_id, score, polygon in zip(
result.boxes.cls.tolist(), result.boxes.conf.tolist(), result.masks.xy
):
print(f"{result.names[int(class_id)]}: {score:.2f}, {len(polygon)} contour points")
If you already downloaded best.pt, load it directly with YOLO("best.pt"). To run the same example from the command line:
yolo segment predict model=best.pt source=person.jpg device=cpu imgsz=512 conf=0.25 retina_masks=True save=True
Evaluation
Validation mask mAP50–95
Mask mAP50–95 is the main metric for evaluating the quality of the predicted garment masks. This plot shows its progression over training epochs on the validation split.

Training history

The full epoch history is available in results.csv. To report the metrics of the exact published checkpoint, evaluate best.pt on the same validation split. In the example below, data.yaml is your local Fashionpedia dataset configuration with the same class mapping used for training.
from ultralytics import YOLO
model = YOLO("best.pt")
metrics = model.val(data="data.yaml", split="val", imgsz=512, device="cpu")
print(f"Mask mAP50–95: {metrics.seg.map:.4f}")
print(f"Mask mAP50: {metrics.seg.map50:.4f}")
print(f"Box mAP50–95: {metrics.box.map:.4f}")
Segmentation curves
| Precision–recall | F1 vs. confidence |
|---|---|
![]() | ![]() |
| Precision vs. confidence | Recall vs. confidence |
|---|---|
![]() | ![]() |
Bounding box curves
| Precision–recall | F1 vs. confidence |
|---|---|
![]() | ![]() |
| Precision vs. confidence | Recall vs. confidence |
|---|---|
![]() | ![]() |
Confusion matrices
| Counts | Normalized |
|---|---|
![]() | ![]() |
Validation gallery
| Batch | Ground truth | Prediction |
|---|---|---|
| 1 | ![]() | ![]() |
| 2 | ![]() | ![]() |
Training data diagnostics

| Training batches near the start | Training batches captured later |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
Intended use and limitations
This is a lab baseline trained on a subset of Fashionpedia. The validation plots describe performance on the reported validation split. Check the predicted masks on your own images before using them for garment editing, especially around thin boundaries and overlapped garments. For a numerical comparison with a DeepFashion2 checkpoint, evaluate both models on the same labeled images with a shared class mapping.
Files and references
best.ptandlast.pt— selected and final training checkpoints.args.yamlandresults.csv— training configuration and epoch history.- Fashionpedia — dataset and annotation reference.
- Ultralytics YOLO26 instance segmentation — inference and evaluation API.





















