segmentation models.pytorch

This repository provides semantic segmentation models with more than 500 pretrained convolutional and transformer backbones.

github.com/qubvel-org/segmentation_models.pyto…
segmentation models.pytorch homepage screenshot

About segmentation models.pytorch

segmentation models.pytorch is an open-source Python library for semantic image segmentation, built on PyTorch. It provides a high-level API for creating segmentation neural networks, with 12 encoder-decoder architectures such as Unet, Unet++, Segformer and DPT. The README states that the library includes more than 800 pretrained convolutional and transformer-based encoders, with timm support. The directory description gives a lower figure of more than 500 backbones.

The library also includes common training metrics and losses, such as Dice, Jaccard and Tversky. Models can be exported to ONNX and are described as compatible with TorchScript, trace and compile. Preparing input data the same way as the encoder's pretraining may improve results, but the README says this step is not required when the whole model is trained rather than only the decoder.

Key features

  • Model creation with a high-level API in about two lines of code
  • 12 encoder-decoder architectures, including Unet, Unet++, Segformer and DPT
  • 800+ pretrained convolution- and transformer-based encoders with timm support
  • Metrics and losses for training, including Dice, Jaccard and Tversky
  • ONNX export of trained models
  • Compatibility with TorchScript, trace and compile
Best for: Machine learning engineers and researchers who build image semantic segmentation models in PyTorch and want a choice of pretrained encoders.
Good for
  • Open source, according to the directory listing.
  • The README states that pretrained encoders can help training converge faster and more stably.
  • The encoder range includes lightweight options for low-latency or edge inference and high-capacity options for complex tasks with many classes.

segmentation models.pytorch at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

segmentation models.pytorch alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in AI Data & Analytics

Well-known listings from the same topic.

All 302

segmentation models.pytorch FAQ

How is a segmentation model created with this library?
The README shows creating a model with smp.Unet, setting the encoder name, encoder weights, number of input channels and number of output classes.
Is data preprocessing required before training?
Not always. Preparing data the same way as during encoder pretraining may give better results, but the README says it is not necessary when training the whole model rather than only the decoder.
Can trained models be exported to ONNX?
The README lists ONNX export as a feature and includes a notebook example for exporting a trained model to ONNX.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing