24 Star 235 Fork 95

PaddlePaddle/PaddleSeg

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
Apache-2.0

English | 简体中文

A High-Efficient Development Toolkit for Image Segmentation Based on PaddlePaddle.

License Version python version support os stars

News

  • [2023-10-29] :fire: PaddleSeg v2.9 is released! Check more details in Release Notes.
  • [2022-04-11] PaddleSeg v2.8 released Segment Anything Model, an original light-weight semantic segmentation model on mobile devices PP-MobileSeg, QualityInspector v0.5, a full-process solution for industrial quality inspection, and PanopticSeg v0.5, a universal panoptic segmentation solution.
  • [2022-11-30] PaddleSeg v2.7 released a real-time human matting model PP-MattingV2, a 3D medical image segmentation solution MedicalSegV2, and a real-time semantic segmentation model RTFormer.
  • [2022-07-20] PaddleSeg v2.6 released a real-time human segmentation SOTA solution PP-HumanSegV2, a stable-version semi-automatic segmentation annotation tool EISeg v1.0, a pseudo label pre-training method PSSL, and the source code of PP-MattingV1.
  • [2022-04-20] PaddleSeg v2.5 released a real-time semantic segmentation model PP-LiteSeg, a trimap-free image matting model PP-MattingV1, and an easy-to-use solution for 3D medical image segmentation MedicalSegV1.
  • [2022-01-20] We release PaddleSeg v2.4 with EISeg v0.4, and PP-HumanSegV1 including an open-sourced dataset PP-HumanSeg14K.

Introduction

PaddleSeg is an end-to-end high-efficent development toolkit for image segmentation based on PaddlePaddle, which helps both developers and researchers in the whole process of designing segmentation models, training models, optimizing performance and inference speed, and deploying models. A lot of well-trained models and various real-world applications in both industry and academia help users conveniently build hands-on experiences in image segmentation.

Features

  • High-Performance Model: Following the state of the art segmentation methods and using high-performance backbone networks, we provide 45+ models and 150+ high-quality pre-training models, which are better than other open-source implementations.

  • High Efficiency: PaddleSeg provides multi-process asynchronous I/O, multi-card parallel training, evaluation, and other acceleration strategies, combined with the memory optimization function of the PaddlePaddle, which can greatly reduce the training overhead of the segmentation model, all these allowing developers to train image segmentation models more efficiently and at a lower cost.

  • Modular Design: We build PaddleSeg with the modular design philosophy. Therefore, based on actual application scenarios, developers can assemble diversified training configurations with data augmentation strategies, segmentation models, backbone networks, loss functions, and other different components to meet different performance and accuracy requirements.

  • Complete Flow: PaddleSeg supports image labeling, model designing, model training, model compression, and model deployment. With the help of PaddleSeg, developers can easily finish all tasks in the entire workflow.

Community

  • If you have any questions, suggestions or feature requests, please do not hesitate to create an issue in GitHub Issues.
  • Please scan the following QR code to join PaddleSeg WeChat group to communicate with us:

Overview

Models Components Special Cases
Backbones
Losses
Metrics
  • mIoU
  • Accuracy
  • Kappa
  • Dice
  • AUC_ROC
Datasets
Data Augmentation
  • Flipping
  • Resize
  • ResizeByLong
  • ResizeByShort
  • LimitLong
  • ResizeRangeScaling
  • ResizeStepScaling
  • Normalize
  • Padding
  • PaddingByAspectRatio
  • RandomPaddingCrop
  • RandomCenterCrop
  • ScalePadding
  • RandomNoise
  • RandomBlur
  • RandomRotation
  • RandomScaleAspect
  • RandomDistort
  • RandomAffine
Segment Anything
Model Selection Tool
Human Segmentation
MedicalSeg
Cityscapes SOTA Model
CVPR Champion Model
Domain Adaptation

Industrial Segmentation Models

High Accuracy Semantic Segmentation Models

These models have good performance and costly inference time, so they are designed for GPU and Jetson devices.

Model Backbone Cityscapes mIoU(%) V100 TRT Inference Speed(FPS) Config File
FCN HRNet_W18 78.97 24.43 yml
FCN HRNet_W48 80.70 10.16 yml
DeepLabV3 ResNet50_OS8 79.90 4.56 yml
DeepLabV3 ResNet101_OS8 80.85 3.2 yml
DeepLabV3 ResNet50_OS8 80.36 6.58 yml
DeepLabV3 ResNet101_OS8 81.10 3.94 yml
OCRNet :star2: HRNet_w18 80.67 13.26 yml
OCRNet HRNet_w48 82.15 6.17 yml
CCNet ResNet101_OS8 80.95 3.24 yml

Note that:

  • We test the inference speed on Nvidia GPU V100. We use PaddleInference Python API with TensorRT enabled. The data type is FP32, and the shape of input tensor is 1x3x1024x2048.
Lightweight Semantic Segmentation Models

The segmentation accuracy and inference speed of these models are medium. They can be deployed on GPU, X86 CPU and ARM CPU.

Model Backbone Cityscapes mIoU(%) V100 TRT Inference Speed(FPS) Snapdragon 855 Inference Speed(FPS) Config File
PP-LiteSeg :star2: STDC1 77.04 69.82 17.22 yml
PP-LiteSeg :star2: STDC2 79.04 54.53 11.75 yml
BiSeNetV1 - 75.19 14.67 1.53 yml
BiSeNetV2 - 73.19 61.83 13.67 yml
STDCSeg STDC1 74.74 62.24 14.51 yml
STDCSeg STDC2 77.60 51.15 10.95 yml
DDRNet_23 - 79.85 42.64 7.68 yml
HarDNet - 79.03 30.3 5.44 yml
SFNet ResNet18_OS8 78.72 10.72 - yml

Note that:

  • We test the inference speed on Nvidia GPU V100. We use PaddleInference Python API with TensorRT enabled. The data type is FP32, and the shape of input tensor is 1x3x1024x2048.
  • We test the inference speed on Snapdragon 855. We use PaddleLite CPP API with 1 thread, and the shape of input tensor is 1x3x256x256.
Super Lightweight Semantic Segmentation Models

These super lightweight semantic segmentation models are designed for X86 CPU and ARM CPU.

Model Backbone ADE20K mIoU(%) Snapdragon 855 Inference latency(ms) params(M) Links
TopFormer-Base TopTransformer-Base 38.28 480.6 5.13 config
PP-MobileSeg-Base :star2: StrideFormer-Base 41.57 265.5 5.62 config
TopFormer-Tiny TopTransformer-Tiny 32.46 490.3 1.41 config
PP-MobileSeg-Tiny :star2: StrideFormer-Tiny 36.39 215.3 1.61 config

Note that:

  • We test the inference speed on Snapdragon 855. We use PaddleLite CPP API with 1 thread, and the shape of input tensor is 1x3x512x512. We test the latency with the final argmax operator on.
Model Backbone Cityscapes mIoU(%) V100 TRT Inference Speed(FPS) Snapdragon 855 Inference Speed(FPS) Config File
MobileSeg MobileNetV2 73.94 67.57 27.01 yml
MobileSeg :star2: MobileNetV3 73.47 67.39 32.90 yml
MobileSeg Lite_HRNet_18 70.75 10.5 13.05 yml
MobileSeg ShuffleNetV2_x1_0 69.46 37.09 39.61 yml
MobileSeg GhostNet_x1_0 71.88 35.58 38.74 yml

Note that:

  • We test the inference speed on Nvidia GPU V100. We use PaddleInference Python API with TensorRT enabled. The data type is FP32, and the shape of input tensor is 1x3x1024x2048.
  • We test the inference speed on Snapdragon 855. We use PaddleLite CPP API with 1 thread, and the shape of input tensor is 1x3x256x256.

Tutorials

Introductory Tutorials

Basic Tutorials

Advanced Tutorials

Welcome to Contribute

Special Features

Industrial Tutorial Examples

For more examples, see here.

License

PaddleSeg is released under the Apache 2.0 license.

Acknowledgement

  • Thanks jm12138 for contributing U2-Net.
  • Thanks zjhellofss (Fu Shenshen) for contributing Attention U-Net, and Dice Loss.
  • Thanks liuguoyu666, geoyee for contributing U-Net++ and U-Net3+.
  • Thanks yazheng0307 (LIU Zheng) for contributing quick-start document.
  • Thanks CuberrChen for contributing STDC(rethink BiSeNet), PointRend and DetailAggregateLoss.
  • Thanks stuartchen1949 for contributing SegNet.
  • Thanks justld (Lang Du) for contributing UPerNet, DDRNet, CCNet, ESPNetV2, DMNet, ENCNet, HRNet_W48_Contrast, FastFCN, BiSeNetV1, SECrossEntropyLoss and PixelContrastCrossEntropyLoss.
  • Thanks Herman-Hu-saber (Hu Huiming) for contributing ESPNetV2.
  • Thanks zhangjin12138 for contributing RandomCenterCrop.
  • Thanks simuler for contributing ESPNetV1.
  • Thanks ETTR123(Zhang Kai) for contributing ENet, PFPNNet.

Citation

If you find our project useful in your research, please consider citing:

@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 Contributors},
    howpublished = {\url{https://github.com/PaddlePaddle/PaddleSeg}},
    year={2019}
}
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import argparse import io, re import sys, os import subprocess import platform COPYRIGHT = ''' Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' LANG_COMMENT_MARK = None NEW_LINE_MARK = None COPYRIGHT_HEADER = None if platform.system() == "Windows": NEW_LINE_MARK = "\r\n" else: NEW_LINE_MARK = '\n' COPYRIGHT_HEADER = COPYRIGHT.split(NEW_LINE_MARK)[1] p = re.search('(\d{4})', COPYRIGHT_HEADER).group(0) process = subprocess.Popen(["date", "+%Y"], stdout=subprocess.PIPE) date, err = process.communicate() date = date.decode("utf-8").rstrip("\n") COPYRIGHT_HEADER = COPYRIGHT_HEADER.replace(p, date) def generate_copyright(template, lang='C'): if lang == 'Python': LANG_COMMENT_MARK = '#' else: LANG_COMMENT_MARK = "//" lines = template.split(NEW_LINE_MARK) BLANK = " " ans = LANG_COMMENT_MARK + BLANK + COPYRIGHT_HEADER + NEW_LINE_MARK for lino, line in enumerate(lines): if lino == 0 or lino == 1 or lino == len(lines) - 1: continue if len(line) == 0: BLANK = "" else: BLANK = " " ans += LANG_COMMENT_MARK + BLANK + line + NEW_LINE_MARK return ans + "\n" def lang_type(filename): if filename.endswith(".py"): return "Python" elif filename.endswith(".h"): return "C" elif filename.endswith(".c"): return "C" elif filename.endswith(".hpp"): return "C" elif filename.endswith(".cc"): return "C" elif filename.endswith(".cpp"): return "C" elif filename.endswith(".cu"): return "C" elif filename.endswith(".cuh"): return "C" elif filename.endswith(".go"): return "C" elif filename.endswith(".proto"): return "C" else: print("Unsupported filetype %s", filename) exit(0) PYTHON_ENCODE = re.compile("^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)") def main(argv=None): parser = argparse.ArgumentParser( description='Checker for copyright declaration.') parser.add_argument('filenames', nargs='*', help='Filenames to check') args = parser.parse_args(argv) retv = 0 for filename in args.filenames: fd = io.open(filename, encoding="utf-8") first_line = fd.readline() second_line = fd.readline() if "COPYRIGHT (C)" in first_line.upper(): continue if first_line.startswith("#!") or PYTHON_ENCODE.match( second_line) != None or PYTHON_ENCODE.match(first_line) != None: continue original_contents = io.open(filename, encoding="utf-8").read() new_contents = generate_copyright( COPYRIGHT, lang_type(filename)) + original_contents print('Auto Insert Copyright Header {}'.format(filename)) retv = 1 with io.open(filename, 'w') as output_file: output_file.write(new_contents) return retv if __name__ == '__main__': exit(main())

About

End-to-End Image Segmentation Suite Based on PaddlePaddle. (『飞桨』图像分割开发套件) expand collapse
Python and 6 more languages
Apache-2.0
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/paddlepaddle/PaddleSeg.git
git@gitee.com:paddlepaddle/PaddleSeg.git
paddlepaddle
PaddleSeg
PaddleSeg
release/2.9

Search

344bd9b3 5694891 D2dac590 5694891