← 开源
open-mmlab

mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.

Model DevelopmentClassical MLPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
9.96k
Star
2.86k
Fork
+1
本周
100
贡献者
创建于 2020-06-14 · 更新于 2026-10-04 · 今日第 7054 名
主要开发者
README

 

OpenMMLab website

  [HOT](https://openmmlab.com)

    
OpenMMLab platform

  [TRY IT OUT](https://platform.openmmlab.com)

 

PyPI - Python Version PyPI docs badge codecov license issue resolution open issues Open in OpenXLab

Documentation:

English | 简体中文

Introduction

MMSegmentation is an open source semantic segmentation toolbox based on PyTorch. It is a part of the OpenMMLab project.

The main branch works with PyTorch 1.6+.

🎉 Introducing MMSegmentation v1.0.0 🎉

We are thrilled to announce the official release of MMSegmentation's latest version! For this new release, the main branch serves as the primary branch, while the development branch is dev-1.x. The stable branch for the previous release remains as the 0.x branch. Please note that the master branch will only be maintained for a limited time before being removed. We encourage you to be mindful of branch selection and updates during use. Thank you for your unwavering support and enthusiasm, and let's work together to make MMSegmentation even more robust and powerful! 💪

MMSegmentation v1.x brings remarkable improvements over the 0.x release, offering a more flexible and feature-packed experience. To utilize the new features in v1.x, we kindly invite you to consult our detailed 📚 migration guide, which will help you seamlessly transition your projects. Your support is invaluable, and we eagerly await your feedback!

demo image

Major features

  • Unified Benchmark

    We provide a unified benchmark toolbox for various semantic segmentation methods.

  • Modular Design

    We decompose the semantic segmentation framework into different components and one can easily construct a customized semantic segmentation framework by combining different modules.

  • Support of multiple methods out of box

    The toolbox directly supports popular and contemporary semantic segmentation frameworks, e.g. PSPNet, DeepLabV3, PSANet, DeepLabV3+, etc.

  • High efficiency

    The training speed is faster than or comparable to other codebases.

What's New

v1.2.0 was released on 10/12/2023, from 1.1.0 to 1.2.0, we have added or updated the following features:

Highlights

  • Support for the open-vocabulary semantic segmentation algorithm SAN

  • Support monocular depth estimation task, please refer to VPD and Adabins for more details.

    depth estimation

  • Add new projects: open-vocabulary semantic segmentation algorithm CAT-Seg, real-time semantic segmentation algofithm PP-MobileSeg

Installation

Please refer to get_started.md for installation and dataset_prepare.md for dataset preparation.

Get Started

Please see Overview for the general introduction of MMSegmentation.

Please see user guides for the basic usage of MMSegmentation. There are also advanced tutorials for in-depth understanding of mmseg design and implementation .

A Colab tutorial is also provided. You may preview the notebook here or directly run on Colab.

To migrate from MMSegmentation 0.x, please refer to migration.

Tutorial

MMSegmentation Tutorials

    Get Started
  

  

    MMSeg Basic Tutorial
  

  

    MMSeg Detail Tutorial
  

  

    MMSeg Development Tutorial
  





  

    
      [MMSeg overview](docs/en/overview.md)
      [MMSeg Installation](docs/en/get_started.md)
      [FAQ](docs/en/notes/faq.md)
    
  

  

    
      [Tutorial 1: Learn about Configs](docs/en/user_guides/1_config.md)
      [Tutorial 2: Prepare datasets](docs/en/user_guides/2_dataset_prepare.md)
      [Tutorial 3: Inference with existing models](docs/en/user_guides/3_inference.md)
      [Tutorial 4: Train and test with existing models](docs/en/user_guides/4_train_test.md)
      [Tutorial 5: Model deployment](docs/en/user_guides/5_deployment.md)
      [Deploy mmsegmentation on Jetson platform](docs/zh_cn/user_guides/deploy_jetson.md)
      [Useful Tools](docs/en/user_guides/useful_tools.md)
      [Feature Map Visualization](docs/en/user_guides/visualization_feature_map.md)
      [Visualization](docs/en/user_guides/visualization.md)
    
  

  

    
      [MMSeg Dataset](docs/en/advanced_guides/datasets.md)
      [MMSeg Models](docs/en/advanced_guides/models.md)
      [MMSeg Dataset Structures](docs/en/advanced_guides/structures.md)
      [MMSeg Data Transforms](docs/en/advanced_guides/transforms.md)
      [MMSeg Dataflow](docs/en/advanced_guides/data_flow.md)
      [MMSeg Training Engine](docs/en/advanced_guides/engine.md)
      [MMSeg Evaluation](docs/en/advanced_guides/evaluation.md)
    
  

  

    
      [Add New Datasets](docs/en/advanced_guides/add_datasets.md)
      [Add New Metrics](docs/en/advanced_guides/add_metrics.md)
      [Add New Modules](docs/en/advanced_guides/add_models.md)
      [Add New Data Transforms](docs/en/advanced_guides/add_transforms.md)
      [Customize Runtime Settings](docs/en/advanced_guides/customize_runtime.md)
      [Training Tricks](docs/en/advanced_guides/training_tricks.md)
      [Contribute code to MMSeg](.github/CONTRIBUTING.md)
      [Contribute a standard dataset in projects](docs/zh_cn/advanced_guides/contribute_dataset.md)
      [NPU (HUAWEI Ascend)](docs/en/device/npu.md)
      [0.x → 1.x migration](docs/en/migration/interface.md)
      [0.x → 1.x package](docs/en/migration/package.md)

Benchmark and model zoo

Results and models are available in the model zoo.

Overview

    Supported backbones
  

  

    Supported methods
  

  

    Supported Head
  

  

    Supported datasets
  

  

    Other
  





  

    
    [ResNet(CVPR'2016)](mmseg/models/backbones/resnet.py)
    [ResNeXt (CVPR'2017)](mmseg/models/backbones/resnext.py)
    [HRNet (CVPR'2019)](configs/hrnet)
    [ResNeSt (ArXiv'2020)](configs/resnest)
    [MobileNetV2 (CVPR'2018)](configs/mobilenet_v2)
    [MobileNetV3 (ICCV'2019)](configs/mobilenet_v3)
    [Vision Transformer (ICLR'2021)](configs/vit)
    [Swin Transformer (ICCV'2021)](configs/swin)
    [Twins (NeurIPS'2021)](configs/twins)
    [BEiT (ICLR'2022)](configs/beit)
    [ConvNeXt (CVPR'2022)](configs/convnext)
    [MAE (CVPR'2022)](configs/mae)
    [PoolFormer (CVPR'2022)](configs/poolformer)
    [SegNeXt (NeurIPS'2022)](configs/segnext)
    
  

  

    
      [SAN (CVPR'2023)](configs/san/)
      [VPD (ICCV'2023)](configs/vpd)
      [DDRNet (T-ITS'2022)](configs/ddrnet)
      [PIDNet (ArXiv'2022)](configs/pidnet)
      [Mask2Former (CVPR'2022)](configs/mask2former)
      [MaskFormer (NeurIPS'2021)](configs/maskformer)
      [K-Net (NeurIPS'2021)](configs/knet)
      [SegFormer (NeurIPS'2021)](configs/segformer)
      [Segmenter (ICCV'2021)](configs/segmenter)
      [DPT (ArXiv'2021)](configs/dpt)
      [SETR (CVPR'2021)](configs/setr)
      [STDC (CVPR'2021)](configs/stdc)
      [BiSeNetV2 (IJCV'2021)](configs/bisenetv2)
      [CGNet (TIP'2020)](configs/cgnet)
      [PointRend (CVPR'2020)](configs/point_rend)
      [DNLNet (ECCV'2020)](configs/dnlnet)
      [OCRNet (ECCV'2020)](configs/ocrnet)
      [ISANet (ArXiv'2019/IJCV'2021)](configs/isanet)
      [Fast-SCNN (ArXiv'2019)](configs/fastscnn)
      [FastFCN (ArXiv'2019)](configs/fastfcn)
      [GCNet (ICCVW'2019/TPAMI'2020)](configs/gcnet)
      [ANN (ICCV'2019)](configs/ann)
      [EMANet (ICCV'2019)](configs/emanet)
      [CCNet (ICCV'2019)](configs/ccnet)
      [DMNet (ICCV'2019)](configs/dmnet)
      [Semantic FPN (CVPR'2019)](configs/sem_fpn)
      [DANet (CVPR'2019)](configs/danet)
      [APCNet (CVPR'2019)](configs/apcnet)
      [NonLocal Net (CVPR'2018)](configs/nonlocal_net)
      [EncNet (CVPR'2018)](configs/encnet)
      [DeepLabV3+ (CVPR'2018)](configs/deeplabv3plus)
      [UPerNet (ECCV'2018)](configs/upernet)
      [ICNet (ECCV'2018)](configs/icnet)
      [PSANet (ECCV'2018)](configs/psanet)
      [BiSeNetV1 (ECCV'2018)](configs/bisenetv1)
      [DeepLabV3 (ArXiv'2017)](configs/deeplabv3)
      [PSPNet (CVPR'2017)](configs/pspnet)
      [ERFNet (T-ITS'2017)](configs/erfnet)
      [UNet (MICCAI'2016/Nat. Methods'2019)](configs/unet)
      [FCN (CVPR'2015/TPAMI'2017)](configs/fcn)
    
  

  

    
      [ANN_Head
      APC_Head
      ASPP_Head
      CC_Head
      DA_Head
      DDR_Head
      DM_Head
      DNL_Head
      DPT_HEAD
      EMA_Head
      ENC_Head
      FCN_Head
      FPN_Head
      GC_Head
      LightHam_Head
      ISA_Head
      Knet_Head
      LRASPP_Head
      mask2former_Head
      maskformer_Head
      NL_Head
      OCR_Head
      PID_Head
      point_Head
      PSA_Head
      PSP_Head
      SAN_Head
      segformer_Head
      segmenter_mask_Head
      SepASPP_Head
      SepFCN_Head
      SETRMLAHead_Head
      SETRUP_Head
      STDC_Head
      Uper_Head
      VPDDepth_Head
    
  

  

    
      Cityscapes](mmseg/models/decode_heads/ann_head.py)
      [PASCAL VOC](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#pascal-voc)
      [ADE20K](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#ade20k)
      [Pascal Context](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#pascal-context)
      [COCO-Stuff 10k](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#coco-stuff-10k)
      [COCO-Stuff 164k](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#coco-stuff-164k)
      [CHASE_DB1](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#chase-db1)
      [DRIVE](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#drive)
      [HRF](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#hrf)
      [STARE](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#stare)
      [Dark Zurich](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#dark-zurich)
      [Nighttime Driving](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#nighttime-driving)
      [LoveDA](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#loveda)
      [Potsdam](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#isprs-potsdam)
      [Vaihingen](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#isprs-vaihingen)
      [iSAID](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#isaid)
      [Mapillary Vistas](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#mapillary-vistas-datasets)
      [LEVIR-CD](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#levir-cd)
      [BDD100K](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#bdd100K)
      [NYU](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#nyu)
      [HSIDrive20](https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/user_guides/2_dataset_prepare.md#hsi-drive-2.0)
    
  

  

    
      Supported loss
    
      [boundary_loss](mmseg/models/losses/boundary_loss.py)
      [cross_entropy_loss](mmseg/models/losses/cross_entropy_loss.py)
      [dice_loss](mmseg/models/losses/dice_loss.py)
      [focal_loss](mmseg/models/losses/focal_loss.py)
      [huasdorff_distance_loss](mmseg/models/losses/huasdorff_distance_loss.py)
      [kldiv_loss](mmseg/models/losses/kldiv_loss.py)
      [lovasz_loss](mmseg/models/losses/lovasz_loss.py)
      [ohem_cross_entropy_loss](mmseg/models/losses/ohem_cross_entropy_loss.py)
      [silog_loss](mmseg/models/losses/silog_loss.py)
      [tversky_loss](mmseg/models/losses/tversky_loss.py)

Please refer to FAQ for frequently asked questions.

Projects

Here are some implementations of SOTA models and solutions built on MMSegmentation, which are supported and maintained by community users. These projects demonstrate the best practices based on MMSegmentation for research and product development. We welcome and appreciate all the contributions to OpenMMLab ecosystem.

Contributing

We appreciate all contributions to improve MMSegmentation. Please refer to CONTRIBUTING.md for the contributing guideline.

Acknowledgement

MMSegmentation is an open source project that welcome any contribution and feedback. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible as well as standardized toolkit to reimplement existing methods and develop their own new semantic segmentation methods.

Citation

If you find this project useful in your research, please consider cite:

@misc{mmseg2020,
    title={{MMSegmentation}: OpenMMLab Semantic Segmentation Toolbox and Benchmark},
    author={MMSegmentation Contributors},
    howpublished = {\url{https://github.com/open-mmlab/mmsegmentation}},
    year={2020}
}

License

This project is released under the Apache 2.0 license.

OpenMMLab Family

  • MMEngine: OpenMMLab foundational library for training deep learning models.
  • MMCV: OpenMMLab foundational library for computer vision.
  • MMPreTrain: OpenMMLab pre-training toolbox and benchmark.
  • MMagic: OpenMMLab Advanced, Generative and Intelligent Creation toolbox.
  • MMDetection: OpenMMLab detection toolbox and benchmark.
  • MMYOLO: OpenMMLab YOLO series toolbox and benchmark.
  • MMDetection3D: OpenMMLab's next-generation platform for general 3D object detection.
  • MMRotate: OpenMMLab rotated object detection toolbox and benchmark.
  • MMTracking: OpenMMLab video perception toolbox and benchmark.
  • MMSegmentation: OpenMMLab semantic segmentation toolbox and benchmark.
  • MMOCR: OpenMMLab text detection, recognition, and understanding toolbox.
  • MMPose: OpenMMLab pose estimation toolbox and benchmark.
  • MMHuman3D: OpenMMLab 3D human parametric model toolbox and benchmark.
  • MMFewShot: OpenMMLab fewshot learning toolbox and benchmark.
  • MMAction2: OpenMMLab's next-generation action understanding toolbox and benchmark.
  • MMFlow: OpenMMLab optical flow toolbox and benchmark.
  • MMDeploy: OpenMMLab Model Deployment Framework.
  • MMRazor: OpenMMLab model compression toolbox and benchmark.
  • MIM: MIM installs OpenMMLab packages.
  • Playground: A central hub for gathering and showcasing amazing projects built upon OpenMMLab.