| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2025-01-08 | 8.4 kB | |
| Segmentation Models - v0.4.0 source code.tar.gz | 2025-01-08 | 4.0 MB | |
| Segmentation Models - v0.4.0 source code.zip | 2025-01-08 | 4.1 MB | |
| Totals: 3 Items | 8.1 MB | 0 | |
New models
Segformer
contributed by @brianhou0208

Originally, SegFormer is a transformer-based semantic segmentation model known for its simplicity and efficiency. It uses a lightweight hierarchical encoder to capture multi-scale features and a minimal decoder for fast inference.
With segmentation-models-pytorch you can utilize the model with a native Mix Vision Transformer encoder as long as with 800+ other encoders supported by the library. Original weights are also supported and can be loaded as follows:
:::python
import segmentation_models_pytorch as smp
model = smp.from_pretrained("smp-hub/segformer-b5-640x640-ade-160k")
or with any other encoder:
:::python
import segmentation_models_pytorch as smp
model = smp.Segformer("resnet34")
See more checkpoints on the HF Hub.
UperNet
contributed by @brianhou0208

UPerNet (Unified Perceptual Parsing Network) is a versatile semantic segmentation model designed to handle diverse scene parsing tasks. It combines a Feature Pyramid Network (FPN) with a Pyramid Pooling Module (PPM) to effectively capture multi-scale context.
:::python
import segmentation_models_pytorch as smp
model = smp.UPerNet("resnet34")
New Encoders
Thanks to @brianhou0208 contribution 800+ timm encoders are now supported in segmentation_models.pytorch. New modern encoders like convnext, efficientvit, efficientformerv2, hiera, mambaout and more can be used as easy as:
:::python
import segmentation_models_pytorch as smp
model = smp.create_model("upernet", encoder_name="tu-mambaout_small")
# or
model = smp.UPerNet("tu-mambaout_small")
New examples
Other changes
- Project migrated to
pyproject.tomlby @adamjstewart - Better dependency managing and testing (minimal and latest dependencies, linux/windows/mac platforms) by @adamjstewart
- Better type annotations
- Tests are refactored for faster CI and local testing by @qubvel
All changes
- Updating the tutorial file by @ytzfhqs in https://github.com/qubvel-org/segmentation_models.pytorch/pull/907
- Example on how to save and load model along with Albumentations preprocessing by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/914
- Add open-in-colab badge for all example notebooks by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/915
- Switch to pyproject.toml by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/917
- Remove dep on mock by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/919
- [feat] Adding camvid segmentation multiclass as an example by @TimbusCalin in https://github.com/qubvel-org/segmentation_models.pytorch/pull/922
- Ruff: format Jupyter notebooks too by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/923
- Remove docker files by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/925
- Test minimum and maximum supported dependencies by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/918
- Test on Linux/macOS/Windows for all supported Python versions by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/930
- Modify Jaccard, Dice and Tversky losses by @zifuwanggg in https://github.com/qubvel-org/segmentation_models.pytorch/pull/927
- [feat] Adding UPerNet by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/926
- Fix dims=None in loss by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/937
- Test PR docs build and update models.rst by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/943
- Update test_models.py by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/940
- Fix UPerNet decoder typo by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/945
- Fix Metric typo by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/966
- Expose timm constructor arguments by @DimitrisMantas in https://github.com/qubvel-org/segmentation_models.pytorch/pull/960
- fix(examples): correct Colab links by @EDM115 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/965
- Update DeepLab models by @DimitrisMantas in https://github.com/qubvel-org/segmentation_models.pytorch/pull/959
- [feat] Adding SegFormer by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/944
- Update MixVisionTransformer by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/975
- silance
"is" with 'str' literalsyntax warning frompretrainedmodelsin python >= 3.12 by @YoniChechik in https://github.com/qubvel-org/segmentation_models.pytorch/pull/987 - Fix DeepLabV3Plus encoder depth by @munehiro-k in https://github.com/qubvel-org/segmentation_models.pytorch/pull/986
- Fix style by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/989
- Add onnx tutorial by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/990
- Fix Segformer decoder performance by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/998
- Add description for non-MIT licensed codes by @junkoda in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1000
- Fix encoder depth & output stride on DeeplabV3 & DeeplabV3+ by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/991
- Update PAN Decoder support encoder depth by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/999
- Update timm universal (support transformer-style model) by @brianhou0208 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1004
- Refactor tests by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1011
- Dependencies: packaging required for testing by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1013
- chore (ci): adopt astral-sh actions by @johnnv1 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1014
- chore (segformer): move decoder converter scripts by @johnnv1 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1017
New Contributors
- @adamjstewart made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/917
- @TimbusCalin made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/922
- @zifuwanggg made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/927
- @brianhou0208 made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/926
- @DimitrisMantas made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/960
- @EDM115 made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/965
- @YoniChechik made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/987
- @munehiro-k made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/986
- @junkoda made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1000
- @johnnv1 made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1014
Full Changelog: https://github.com/qubvel-org/segmentation_models.pytorch/compare/v0.3.4...v0.4.0