> This is the documentation for LibreYOLO 1.6.0. Current version: https://www.libreyolo.com/docs/models/ppliteseg

# PP-LiteSeg
PP-LiteSeg assigns a semantic class to each pixel using an STDC backbone and a fusion decoder.
Tasks: Semantic segmentation. Install: pip install libreyolo.
Verified against LibreYOLO v1.6.0.

## Install

```bash
pip install "libreyolo"
```

## Predict

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

model = LibreYOLO("LibrePPLiteSegt50-sem.pt", device="cpu")
result = model(SAMPLE_IMAGE)
print(result.semantic_mask)
```

The t50 and b50 variants evaluate at `(512, 1024)`; t75 and b75 evaluate at `(768, 1536)`. Dimensions are `(height, width)`.

## Train

Training defaults to 800 epochs, batch 8 and `amp=False`. The default crop is `(512, 1024)` for t50/b50 and `(768, 768)` for t75/b75. Validation keeps the native rectangle. The recipe combines cross-entropy, Dice and edge losses with auxiliary heads.

[Dataset setup](/docs/v1.6.0/train/datasets) describes the required training data.

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibrePPLiteSegt50-sem.pt", device="cpu")
# Semantic segmentation dataset YAML: images plus single-channel class-ID masks.
model.train(data="path/to/your/semantic.yaml", epochs=1, device="cpu", workers=0)
```


## Validate

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibrePPLiteSegt50-sem.pt", device="cpu")
# Semantic segmentation dataset YAML with 19 Cityscapes classes, like cityscapes.yaml.
metrics = model.val(data="path/to/your/semantic.yaml", workers=0)
print(metrics)
```

Use the dataset format for this task. [Validation](/docs/v1.6.0/train/validation) explains the dataset requirements and returned metrics.

## Export

| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Semantic segmentation | yes | yes |  | yes | yes |  |  |  |  |  |  |  |

A "yes" means the export is supported. An empty cell means the exporter refuses that combination.

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

model = LibreYOLO("LibrePPLiteSegt50-sem.pt", device="cpu")
model.export(format="onnx")
```

[Export setup](/docs/v1.6.0/export) lists format dependencies and loading exported artifacts.

## Checkpoints

| File | Input (px) | Task | Weights license |
| --- | --- | --- | --- |
| `LibrePPLiteSegt50-sem.pt` |  | Semantic segmentation | apache-2.0 |
| `LibrePPLiteSegb50-sem.pt` |  | Semantic segmentation | apache-2.0 |
| `LibrePPLiteSegt75-sem.pt` |  | Semantic segmentation | apache-2.0 |
| `LibrePPLiteSegb75-sem.pt` |  | Semantic segmentation | apache-2.0 |

## Licensing

Check the license on the Hugging Face repository of the specific weights you download. That repository is authoritative and licenses are not always uniform across a family. This is a description of the licenses involved, not legal advice.

- Original work: PP-LiteSeg, PaddlePaddle
- Upstream license: Apache-2.0
- Upstream source: https://github.com/PaddlePaddle/PaddleSeg
- LibreYOLO code: MIT
- Weights: Apache-2.0, republished at https://huggingface.co/LibreYOLO
- Interpretation: The upstream implementation declares Apache-2.0. The STDC backbone also carries its original MIT attribution. The released checkpoints are converted from the Deci-AI/super-gradients Cityscapes artifacts; SuperGradients is released under Apache-2.0 and grants separate weight licenses only for YOLO-NAS, so these checkpoints carry Apache-2.0.


## PP-LiteSeg architecture

- t50: [SVG](/diagrams/models/ppliteseg/t50-semantic.svg), [interactive diagram](/diagrams/models/ppliteseg/t50-semantic.html)
- b50: [SVG](/diagrams/models/ppliteseg/b50-semantic.svg), [interactive diagram](/diagrams/models/ppliteseg/b50-semantic.html)
- t75: [SVG](/diagrams/models/ppliteseg/t75-semantic.svg), [interactive diagram](/diagrams/models/ppliteseg/t75-semantic.html)
- b75: [SVG](/diagrams/models/ppliteseg/b75-semantic.svg), [interactive diagram](/diagrams/models/ppliteseg/b75-semantic.html)
- Shared topology: [SVG](/diagrams/models/ppliteseg/family.svg), [interactive diagram](/diagrams/models/ppliteseg/family.html)
