PP-LiteSeg
PP-LiteSeg assigns a semantic class to each pixel using an STDC backbone and a fusion decoder.
- 任务
- semantic segmentation
- 安装
pip install libreyolo- 支持层级
- 已支持,自 v1.6.0 起。起支撑作用的可训练家族:在 CI 里保持绿色,功能视情况落地。
- 许可
- 代码采用 MIT,权重采用 Apache-2.0。商用
Install
pip install "libreyolo"Predict
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 describes the required training data.
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
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 explains the dataset requirements and returned metrics.
Export
| 任务 | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Semantic segmentation | Semantic segmentation to ONNX:支持 | Semantic segmentation to TorchScript:支持 | Semantic segmentation to ExecuTorch:不支持 | Semantic segmentation to TensorRT:支持 | Semantic segmentation to OpenVINO:支持 | Semantic segmentation to Paddle:不支持 | Semantic segmentation to MNN:不支持 | Semantic segmentation to RKNN:不支持 | Semantic segmentation to ncnn:不支持 | Semantic segmentation to TFLite:不支持 | Semantic segmentation to CoreML:不支持 | Semantic segmentation to Core AI:不支持 |
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibrePPLiteSegt50-sem.pt", device="cpu")model.export(format="onnx")Export setup lists format dependencies and loading exported artifacts.
Checkpoints
| 文件 | 权重许可 |
|---|---|
| Semantic segmentation | |
| LibrePPLiteSegt50-sem.pt | apache-2.0 |
| LibrePPLiteSegb50-sem.pt | apache-2.0 |
| LibrePPLiteSegt75-sem.pt | apache-2.0 |
| LibrePPLiteSegb75-sem.pt | apache-2.0 |
上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。
Licensing
请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。
这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。
- 原始工作
- PP-LiteSeg, PaddlePaddle
- 上游许可
- Apache-2.0
- LibreYOLO 代码
- MIT
- 权重
- 采用 Apache-2.0 许可,重新发布在 huggingface.co/LibreYOLO
- 解读
- 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.