Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.4.0 #1025

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Release 0.4.0 #1025

merged 2 commits into from
Jan 8, 2025

Conversation

qubvel
Copy link
Collaborator

@qubvel qubvel commented Jan 7, 2025

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:

import segmentation_models_pytorch as smp

model = smp.from_pretrained("smp-hub/segformer-b5-640x640-ade-160k")

See more checkpoints on the HF Hub.

Or with any other supported encoder:

import segmentation_models_pytorch as smp

model = smp.Segformer("resnet34")

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.

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 others can be used as easily as:

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.toml by @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

...

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
segmentation_models_pytorch/__version__.py 100.00% <100.00%> (ø)

@qubvel
Copy link
Collaborator Author

qubvel commented Jan 7, 2025

I'm going to make a release tomorrow, feel free to to add anything to release notes in case I forgot something/someone (there will be a full list of changes also, without dependabot PRs).

@qubvel qubvel requested a review from adamjstewart January 7, 2025 23:34
Copy link
Collaborator

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passing. Only warnings are due to our pretrainedmodels dep which I plan on removing anyway. Should be good to go!

@qubvel qubvel merged commit 12f8394 into main Jan 8, 2025
14 checks passed
@adamjstewart adamjstewart deleted the release-0.4.0 branch January 8, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants