| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-10-26 | 7.1 kB | |
| Segmentation Models - v0.6.0 source code.tar.gz | 2026-10-26 | 4.5 MB | |
| Segmentation Models - v0.6.0 source code.zip | 2026-10-26 | 4.6 MB | |
| Totals: 3 Items | 9.2 MB | 0 | |
⚠️ Breaking changes
- Python 3.10+ is required, and the minimum dependency versions went up:
torch>=1.11,torchvision>=0.12,numpy>=1.21.2,pillow>=8.4(#1281). - Encoder weights are downloaded only from the Hugging Face Hub. The old fallback to the original download URLs is gone, along with
smp.encoders.pretrained_settings. If you can't reach the Hub, setHF_ENDPOINTto a mirror or load weights from a local file (#1398). tu-encoders now warn whenencoder_weightsis a string. UseTrueorNone, and choose the pretrained variant in the name, e.g.tu-convnext_tiny.fb_in22k(#1269).
Highlights
Freeze and unfreeze the encoder
:::python
model = smp.Unet("resnet34")
model.freeze_encoder() # also stops BatchNorm running-stat updates
...
model.unfreeze_encoder()
- Add
encoder_freezemethod to SegmentationModel by @ricber in [#1220]
Losses
class_weightsforDiceLoss,JaccardLoss,TverskyLossandFocalLoss(multiclass and multilabel modes):python loss = smp.losses.DiceLoss("multiclass", class_weights=[0.2, 1.0, 3.0])FocalLossaccepts probabilities viafrom_logits=False, with anepsparameter likeDiceLoss.JaccardLosssupportsignore_index.- Losses work on non-contiguous tensors.
Models and encoders
- Transformer-style
tu-encoders work inUnetPlusPlusandLinknet(#1294). - PSPNet exports to ONNX (#1270).
- Fixed an MPS float tensor
ValueError(#1199).
What's Changed
- Fix PyPI package upload by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1128
- Fix notebook rendering by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1130
- Update pypi release by @qubvel in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1131
- Update no_grad usage to inference_mode by @GuillaumeErhard in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1164
- Explicitly set
reductionfor Focal loss by @simonreise in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1165 - Add
ignore_indexto Jaccard loss by @simonreise in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1151 - Replaced
viewwithreplaceto prevent errors on non-contiguous tensors by @simonreise in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1174 - Fix minor typo in dice.py by @snehilsanyal in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1181
- Fix/issue 1198 value error invalid type torch.mps.float tensor by @Farbdrucker in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1199
- Add missing name attribute to deeplabv3 & deeplabv3plus by @sanamorii in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1214
- Add encoder_freeze method to SegmentationModel by @ricber in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1220
- feat: Adding withoutBG by @kocabiyik in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1261
- fix: TorchFix Errors by @isaaccorley in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1262
- docs: Clarify tu- encoder_weights behavior as boolean flag by @GuillaumeErhard in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1269
- CI: test Python 3.12+ by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1282
- Python: bump minimum supported version to 3.10 by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1281
- Codecov: don't comment on PRs by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1283
- setuptools: adopt PEP 639 license metadata by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1280
- Update HALLOFFAME.md with ICIP2025 results by @caglarmert in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1293
- Docs: fix unexpected indentation around lists by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1297
- Docs: fix title underline length by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1296
- Fix PSPNet ONNX export issue by @lapertor in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1270
- feat(losses): add class_weights support to Dice, Jaccard, Tversky and Focal losses by @lapertor in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1290
- Docs: enable nitpicky mode and fix broken links by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1300
- Docs: avoid duplicate target links by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1299
- Add from_logits support to FocalLoss and eps for API consistency with DiceLoss by @Harsh-2005d in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1268
- Support transformer-style tu- encoders in UnetPlusPlus and Linknet by @ShunsukeKikuchi in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1294
- Docs: ignore encoders_dpt missing from any toctree by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1298
- Docs: enable strict mode by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1301
- Harden legacy URL fallback: pass weights_only=True to load_url by @mohammedix88 in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1393
-
Security hardening: http -> https by @adamjstewart in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1398
-
… plus 187 dependency updates by @dependabot
New Contributors
- @simonreise made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1165
- @snehilsanyal made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1181
- @Farbdrucker made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1199
- @sanamorii made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1214
- @ricber made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1220
- @isaaccorley made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1262
- @caglarmert made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1293
- @lapertor made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1270
- @Harsh-2005d made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1268
- @ShunsukeKikuchi made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1294
- @mohammedix88 made their first contribution in https://github.com/qubvel-org/segmentation_models.pytorch/pull/1393
Full Changelog: https://github.com/qubvel-org/segmentation_models.pytorch/compare/v0.5.0...v0.6.0