qubvel-org/segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.

What it solves

This library provides a high-level API for creating neural networks for image semantic segmentation. It simplifies the process of building segmentation models by providing pre-built architectures and a vast library of pretrained encoders, reducing the need to manually implement complex model structures from scratch.

How it works

The library allows users to instantiate a segmentation model by combining a chosen encoder (backbone) and a decoder architecture. It extracts intermediate features from the encoder and feeds them into the decoder to produce a segmentation mask. It supports a wide range of of convolution- and transform-based encoders, including those from the timm library, and provides built-in metrics and losses for training.

Who it’s for

Computer vision engineers and researchers who need to implement image semantic segmentation tasks, ranging from lightweight models for edge devices to high-capacity architectures for complex, multi-class segmentation.

Highlights

  • Extensive Architecture Support: Includes 12 encoder-decoder architectures such as Unet, Unet++, Segformer, and DeepLabV3+.
  • Pretrained Encoders: Access to over 800 pretrained encoders to ensure faster and more stable convergence.
  • Flexible Input/Output: Supports arbitrary input channels and optional auxiliary classification outputs.
  • Deployment Ready: Compatible with ONNX export and torch script/trace/compile for efficient inference.
  • Training Utilities: Includes popular segmentation-specific metrics and losses like Dice and Jaccard.

Related

  • Project
  • Project
  • Project
  • Project
  • Project