# PaddleSeg
**Repository Path**: paddlepaddle/PaddleSeg
## Basic Information
- **Project Name**: PaddleSeg
- **Description**: End-to-End Image Segmentation Suite Based on PaddlePaddle. (『飞桨』图像分割开发套件)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Default Branch**: release/2.10
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 247
- **Forks**: 100
- **Created**: 2020-03-31
- **Last Updated**: 2025-10-09
## Categories & Tags
**Categories**: image-processing, ai
**Tags**: None
## README
简体中文 | [English](README_EN.md)
  
**飞桨高性能图像分割开发套件,端到端完成从训练到部署的全流程图像分割应用。**
[](LICENSE)
[](https://github.com/PaddlePaddle/PaddleSeg/releases)



 
## 
 最新动态
- **🔥[2024-11-05] 添加语义分割领域低代码全流程开发能力**:
  *  飞桨低代码开发工具PaddleX,依托于PaddleSeg的先进技术,支持了图像分割领域的**低代码全流程**开发能力:
     * 🎨 [**模型丰富一键调用**](docs/paddlex/quick_start.md):将通用语义分割和图像异常检测涉及的**19个模型**整合为2条模型产线,通过极简的**Python API一键调用**,快速体验模型效果。此外,同一套API,也支持图像分类、目标检测、文本图像智能分析、通用OCR、时序预测等共计**200+模型**,形成20+单功能模块,方便开发者进行**模型组合使用**。
     * 🚀 [**提高效率降低门槛**](docs/paddlex/overview.md):提供基于**统一命令**和**图形界面**两种方式,实现模型简洁高效的使用、组合与定制。支持**高性能部署、服务化部署和端侧部署**等多种部署方式。此外,对于各种主流硬件如**英伟达GPU、昆仑芯、昇腾、寒武纪和海光**等,进行模型开发时,都可以**无缝切换**。
  *  增加图像异常检测算法[**SFTPM**](https://paddlepaddle.github.io/PaddleX/latest/module_usage/tutorials/cv_modules/anomaly_detection.html)
* [2023-10-29] :fire:  PaddleSeg 2.9版本发布!详细发版信息请参考[Release Note](https://github.com/PaddlePaddle/PaddleSeg/releases)。
  * 增加对多标签分割[Multi-label segmentation](./configs/multilabelseg),提供数据转换代码及结果可视化,实现对一系列语义分割模型的多标签分割支持。
  * 发布轻量视觉大模型[MobileSAM](./contrib/SegmentAnything),实现更快速的SAM推理。
  * 支持量化蒸馏训练压缩功能[Quant Aware Distillation Training Compression](./deploy/slim/act),对PP-LiteSeg、PP-MobileSeg、OCRNet、SegFormer-B0增加量化训练压缩功能,提升推理速度。
## 
 简介
**PaddleSeg**是基于飞桨PaddlePaddle的端到端图像分割套件,内置**45+模型算法**及**140+预训练模型**,支持**配置化驱动**和**API调用**开发方式,打通数据标注、模型开发、训练、压缩、部署的**全流程**,提供**语义分割、交互式分割、Matting、全景分割**四大分割能力,助力算法在医疗、工业、遥感、娱乐等场景落地应用。
## 
 特性
* **高精度**:跟踪学术界的前沿分割技术,结合高精度训练的骨干网络,提供45+主流分割网络、150+的高质量预训练模型,效果优于其他开源实现。
* **高性能**:使用多进程异步I/O、多卡并行训练、评估等加速策略,结合飞桨核心框架的显存优化功能,大幅度减少分割模型的训练开销,让开发者更低成本、更高效地完成图像分割训练。
* **模块化**:源于模块化设计思想,解耦数据准备、分割模型、骨干网络、损失函数等不同组件,开发者可以基于实际应用场景出发,组装多样化的配置,满足不同性能和精度的要求。
* **全流程**:打通数据标注、模型开发、模型训练、模型压缩、模型部署全流程,经过业务落地的验证,让开发者完成一站式开发工作。
## [⚡ 快速开始](docs/paddlex/quick_start.md)
## 🔥 [低代码全流程开发](docs/paddlex/overview.md)
## 
 产品矩阵
  
    
      | 
        模型
       | 
      
        组件
       | 
      
        特色案例
       | 
    
    
      
        
        语义分割模型
          
         
        交互式分割模型
          
         
        图像抠图模型
          
         
        全景分割
          
         
        | 
      
        骨干网络
          
         
        损失函数
          
         
        评估指标
          
            - mIoU
 
            - Accuracy
 
            - Kappa
 
            - Dice
 
            - AUC_ROC
 
             
         
       | 
      
        支持数据集
          
         
        数据增强
          
            - Flipping
   
            - Resize
   
            - ResizeByLong
 
            - ResizeByShort
 
            - LimitLong
   
            - ResizeRangeScaling
   
            - ResizeStepScaling
 
            - Normalize
 
            - Padding
 
            - PaddingByAspectRatio
 
            - RandomPaddingCrop
   
            - RandomCenterCrop
 
            - ScalePadding
 
            - RandomNoise
   
            - RandomBlur
   
            - RandomRotation
   
            - RandomScaleAspect
   
            - RandomDistort
   
            - RandomAffine
   
           
         
       | 
      
        分割一切模型
          
         
        模型选型工具
          
         
        人像分割模型
          
         
        3D医疗分割模型
          
         
        Cityscapes打榜模型
          
         
        CVPR冠军模型
          
         
        领域自适应
          
         
       |   
    
    
  
## 
 产业级分割模型库
高精度语义分割模型
#### 高精度模型,分割mIoU高、推理算量大,适合部署在服务器端GPU和Jetson等设备。
| 模型名称  | 骨干网络   | Cityscapes精度mIoU(%) |  V100 TRT推理速度(FPS)  |  配置文件 |
|:-------- |:--------:|:---------------------:|:---------------------:|:--------:|
| FCN            | HRNet_W18        | 78.97                 | 24.43     | [yml](./configs/fcn/)         |
| FCN            | HRNet_W48        | 80.70                 | 10.16     | [yml](./configs/fcn/)         |
| DeepLabV3      | ResNet50_OS8     | 79.90                 | 4.56      | [yml](./configs/deeplabv3/)   |
| DeepLabV3      | ResNet101_OS8    | 80.85                 | 3.2       | [yml](./configs/deeplabv3/)   |
| DeepLabV3      | ResNet50_OS8     | 80.36                 | 6.58      | [yml](./configs/deeplabv3p/)  |
| DeepLabV3      | ResNet101_OS8    | 81.10                 | *3.94*    | [yml](./configs/deeplabv3p/)  |
| OCRNet :star2:    | HRNet_w18        | 80.67                 | 13.26     | [yml](./configs/ocrnet/)      |
| OCRNet         | HRNet_w48        | 82.15                 | 6.17      | [yml](./configs/ocrnet/)      |
| CCNet          | ResNet101_OS8    | 80.95                 | 3.24      | [yml](./configs/ccnet/)       |
测试条件:
* V100上测速条件:针对Nvidia GPU V100,使用PaddleInference预测库的Python API,开启TensorRT加速,数据类型是FP32,输入图像维度是1x3x1024x2048。
 
轻量级语义分割模型
#### 轻量级模型,分割mIoU中等、推理算量中等,可以部署在服务器端GPU、服务器端X86 CPU和移动端ARM CPU。
| 模型名称  | 骨干网络   | Cityscapes精度mIoU(%) |  V100 TRT推理速度(FPS) | 骁龙855推理速度(FPS) |  配置文件 |
|:-------- |:--------:|:---------------------:|:---------------------:|:-----------------:|:--------:|
| PP-LiteSeg :star2:    | STDC1         | 77.04               | 69.82           | 17.22      | [yml](./configs/pp_liteseg/)  |
| PP-LiteSeg :star2:      | STDC2         | 79.04               | 54.53           | 11.75       | [yml](./configs/pp_liteseg/)  |
| BiSeNetV1           | -             | 75.19               | 14.67           | 1.53      |[yml](./configs/bisenetv1/)  |
| BiSeNetV2           | -             | 73.19               | 61.83           | 13.67       |[yml](./configs/bisenet/)  |
| STDCSeg             | STDC1         | 74.74               | 62.24           | 14.51       |[yml](./configs/stdcseg/)  |
| STDCSeg             | STDC2         | 77.60               | 51.15           | 10.95       |[yml](./configs/stdcseg/)  |
| DDRNet_23           | -             | 79.85               | 42.64           | 7.68      |[yml](./configs/ddrnet/)  |
| HarDNet             | -             | 79.03               | 30.3            | 5.44      |[yml](./configs/hardnet/)  |
| SFNet               | ResNet18_OS8  |  78.72              | *10.72*         |   -         | [yml](./configs/sfnet/)  |
测试条件:
* V100上测速条件:针对Nvidia GPU V100,使用PaddleInference预测库的Python API,开启TensorRT加速,数据类型是FP32,输入图像维度是1x3x1024x2048。
* 骁龙855上测速条件:针对小米9手机,使用PaddleLite预测库的CPP API,ARMV8编译,单线程,输入图像维度是1x3x256x256。
 
超轻量级语义分割模型
#### 超轻量级模型,分割mIoU一般、推理算量低,适合部署在服务器端X86 CPU和移动端ARM CPU。
| 模型名称 | 骨干网络 | ADE20K精度mIoU(%) | 骁龙855推理延时(ms) | 参数量(M) | 配置文件 |
|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|
|TopFormer-Base|TopTransformer-Base|38.28|480.6|5.13|[config](./configs/topformer/)
|PP-MobileSeg-Base|StrideFormer-Base|41.57|265.5|5.62|[config](./configs/pp_mobileseg/)|
|TopFormer-Tiny|TopTransformer-Tiny|32.46|490.3|1.41|[config](./configs/topformer/)
|PP-MobileSeg-Tiny|StrideFormer-Tiny|36.39|215.3|1.61|[config](./configs/pp_mobileseg/)|
测试条件:
* 针对小米9手机,使用[PaddleLite](https://github.com/PaddlePaddle/Paddle-Lite/blob/develop/README_en.md)预测库的CPP API,ARMV8编译,单线程,输入图像维度是1x3x512x512。测试模型在带有最后一个argmax算子的条件下进行测试。
| 模型名称  | 骨干网络   | Cityscapes精度mIoU(%) |  V100 TRT推理速度(FPS)  | 骁龙855推理速度(FPS)|  配置文件 |
|:-------- |:--------:|:---------------------:|:---------------------:|:-----------------:|:--------:|
| MobileSeg      | MobileNetV2              | 73.94                 | 67.57          | 27.01   | [yml](./configs/mobileseg/)  |
| MobileSeg :star2:  | MobileNetV3              | 73.47                 | 67.39          | 32.90   | [yml](./configs/mobileseg/)  |
| MobileSeg      | Lite_HRNet_18            | 70.75                 | *10.5*         | 13.05   | [yml](./configs/mobileseg/)  |
| MobileSeg      | ShuffleNetV2_x1_0        | 69.46                 | *37.09*        | 39.61  | [yml](./configs/mobileseg/)  |
| MobileSeg      | GhostNet_x1_0            | 71.88                 | *35.58*        | 38.74  | [yml](./configs/mobileseg/)  |
测试条件:
* V100上测速条件:针对Nvidia GPU V100,使用PaddleInference预测库的Python API,开启TensorRT加速,数据类型是FP32,输入图像维度是1x3x1024x2048。
* 骁龙855上测速条件:针对小米9手机,使用PaddleLite预测库的CPP API,ARMV8编译,单线程,输入图像维度是1x3x256x256。
 
## 
 使用教程
**入门教程**
* [安装说明](./docs/install_cn.md)
* [快速体验](./docs/quick_start_cn.md)
* [20分钟快速上手PaddleSeg](./docs/whole_process_cn.md)
* [模型库](./docs/model_zoo_overview_cn.md)
**基础教程**
* 准备数据集
   * [准备公开数据集](./docs/data/pre_data_cn.md)
   * [准备自定义数据集](./docs/data/marker/marker_cn.md)
   * [EISeg 数据标注](./EISeg)
* [准备配置文件](./docs/config/pre_config_cn.md)
* [模型训练](./docs/train/train_cn.md)
* [模型评估](./docs/evaluation/evaluate_cn.md)
* [模型预测](./docs/predict/predict_cn.md)
* 模型导出
    * [导出预测模型](./docs/model_export_cn.md)
    * [导出ONNX模型](./docs/model_export_onnx_cn.md)
* 模型部署
    * [FastDeploy部署](./deploy/fastdeploy)
    * [Paddle Inference部署(Python)](./docs/deployment/inference/python_inference_cn.md)
    * [Paddle Inference部署(C++)](./docs/deployment/inference/cpp_inference_cn.md)
    * [Paddle Lite部署](./docs/deployment/lite/lite_cn.md)
    * [Paddle Serving部署](./docs/deployment/serving/serving_cn.md)
    * [Paddle JS部署](./docs/deployment/web/web_cn.md)
    * [推理Benchmark](./docs/deployment/inference/infer_benchmark_cn.md)
**进阶教程**
* [训练技巧](./docs/train/train_tricks_cn.md)
* 模型压缩
    * [量化](./docs/deployment/slim/quant/quant_cn.md)
    * [蒸馏](./docs/deployment/slim/distill/distill_cn.md)
    * [裁剪](./docs/deployment/slim/prune/prune_cn.md)
    * [自动压缩](./docs/deployment/slim/act/readme.md)
* [常见问题汇总](./docs/faq/faq/faq_cn.md)
**欢迎贡献**
* [API文档](./docs/apis/README_CN.md)
*  二次开发教程
    * [配置文件详解](./docs/design/use/use_cn.md)
    * [如何创造自己的模型](./docs/design/create/add_new_model_cn.md)
*  模型贡献
    * [提交PR说明](./docs/pr/pr/pr_cn.md)
    * [模型PR规范](./docs/pr/pr/style_cn.md)
## 
 特色能力
- [交互式分割](./EISeg)
- [图像抠图](./Matting)
- [人像分割](./contrib/PP-HumanSeg)
- [3D医疗分割](./contrib/MedicalSeg)
- [Cityscapes打榜模型](./contrib/CityscapesSOTA)
- [全景分割](./contrib/PanopticDeepLab)
- [CVPR冠军模型](./contrib/AutoNUE)
- [领域自适应](./contrib/DomainAdaptation)
## 
 产业实践范例
* [使用PP-HumanSegV2进行人像分割](https://aistudio.baidu.com/aistudio/projectdetail/4504982?contributionType=1)
* [使用PP-HumanSegV1进行人像分割](https://aistudio.baidu.com/aistudio/projectdetail/2189481?channelType=0&channel=0)
* [使用PP-LiteSeg进行遥感道路分割](https://aistudio.baidu.com/aistudio/projectdetail/3873145?contributionType=1)
* [PaddleSeg实战之人脸部件分割与变妆](https://aistudio.baidu.com/aistudio/projectdetail/5326422)
* [PaddleSeg实战之小数据集3D椎骨分割](https://aistudio.baidu.com/aistudio/projectdetail/3878920)
* [PaddleSeg实战之车道线图像分割](https://aistudio.baidu.com/aistudio/projectdetail/1752986?channelType=0&channel=0)
* [PaddleSeg动态图API使用教程](https://aistudio.baidu.com/aistudio/projectdetail/1339458?channelType=0&channel=0)
* [10分钟上手PaddleSeg](https://aistudio.baidu.com/aistudio/projectdetail/1672610?channelType=0&channel=0)
* [车路协同:交互式分割技术在智慧建图中的应用和实践](https://aistudio.baidu.com/aistudio/projectdetail/5089472)
* [基于PaddleSeg的美甲预览机](https://aistudio.baidu.com/aistudio/projectdetail/5156312)
* [基于PaddleSeg的钢筋长度超限监控](https://aistudio.baidu.com/aistudio/projectdetail/5633532)
更多范例项目可参考:[『图像分割经典项目集』用PaddleSeg能做什么?](https://aistudio.baidu.com/aistudio/projectdetail/5436669)
## 许可证书
本项目的发布受Apache 2.0 license许可认证。
## 社区贡献
- 非常感谢[jm12138](https://github.com/jm12138)贡献U2-Net模型。
- 非常感谢[zjhellofss](https://github.com/zjhellofss)(傅莘莘)贡献Attention U-Net模型,和Dice loss损失函数。
- 非常感谢[liuguoyu666](https://github.com/liguoyu666)贡献U-Net++模型。
- 非常感谢[yazheng0307](https://github.com/yazheng0307) (刘正)贡献快速开始教程文档。
- 非常感谢[CuberrChen](https://github.com/CuberrChen)贡献STDC (rethink BiSeNet) PointRend,和 Detail Aggregate损失函数。
- 非常感谢[stuartchen1949](https://github.com/stuartchen1949)贡献 SegNet。
- 非常感谢[justld](https://github.com/justld)(郎督)贡献 UPerNet, DDRNet, CCNet, ESPNetV2, DMNet, ENCNet, HRNet_W48_Contrast, BiSeNetV1, FastFCN, SECrossEntropyLoss 和PixelContrastCrossEntropyLoss。
- 非常感谢[Herman-Hu-saber](https://github.com/Herman-Hu-saber)(胡慧明)参与贡献 ESPNetV2。
- 非常感谢[zhangjin12138](https://github.com/zhangjin12138)贡献数据增强方法 RandomCenterCrop。
- 非常感谢[simuler](https://github.com/simuler) 贡献 ESPNetV1。
- 非常感谢[ETTR123](https://github.com/ETTR123)(张恺) 贡献 ENet,PFPNNet。
## 
 学术引用
如果我们的项目在学术上帮助到你,请考虑以下引用:
```latex
@misc{liu2021paddleseg,
      title={PaddleSeg: A High-Efficient Development Toolkit for Image Segmentation},
      author={Yi Liu and Lutao Chu and Guowei Chen and Zewu Wu and Zeyu Chen and Baohua Lai and Yuying Hao},
      year={2021},
      eprint={2101.06175},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@misc{paddleseg2019,
    title={PaddleSeg, End-to-end image segmentation kit based on PaddlePaddle},
    author={PaddlePaddle Authors},
    howpublished = {\url{https://github.com/PaddlePaddle/PaddleSeg}},
    year={2019}
}
```