Skip to content

[feat] Adding UPerNet #926

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

Merged
merged 8 commits into from
Oct 5, 2024
Merged

[feat] Adding UPerNet #926

merged 8 commits into from
Oct 5, 2024

Conversation

brianhou0208
Copy link
Contributor

@brianhou0208 brianhou0208 commented Sep 15, 2024

Description

I tried to add UperNet before. This may not be the best version. Maybe you can have a look.
@GrantorShadow @jawi289o

Issue

#906

Reference

Copy link
Collaborator

@qubvel qubvel left a comment

Choose a reason for hiding this comment

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

Hi @brianhou0208, thanks a lot for working on this! Looks good to me, a few general notes/questions

  • Can you please use more verbose variable naming, e.g. ch->channels, h -> height (it is not hold over the repo, but would be nice to have it)
  • Please, add the model to the docs/ and README.md
  • Did you have a chance to train it with any notebook example?

@brianhou0208
Copy link
Contributor Author

Hi @qubvel , I’ve updated the code according to the commit, along with the README and documentation.
I’ve also trained the model using the binary_segmentation_intro.ipynb, and the results are shown below.

Due to device limitations, the default parameters caused an OOM error, so I adjusted the decoder_pyramid_channels and decoder_segmentation_channels parameters.

  • Valid Dataset
Arch Backbone pyramid_channels segmentation_channels IoU (Per Image / Dataset)
UPerNet ResNet34 32 32 90.51 / 91.35
UPerNet ResNet34 32 16 90.48 / 91.38
UPerNet ResNet34 32 8 90.01 / 90.92
FPN ResNet34 - - 90.56 / 91.39
DeepLabV3Plus ResNet34 - - 90.26 / 91.07
UNet ResNet34 - - 90.50 / 91.31
  • Test Dataset
Arch Backbone pyramid_channels segmentation_channels IoU (Per Image / Dataset)
UPerNet ResNet34 32 32 91.11 / 91.75
UPerNet ResNet34 32 16 91.10 / 91.76
UPerNet ResNet34 32 8 91.01 / 91.73
FPN ResNet34 - - 90.97 / 91.64
DeepLabV3Plus ResNet34 - - 90.48 / 91.22
UNet ResNet34 - - 91.15 / 91.76

@brianhou0208 brianhou0208 requested a review from qubvel September 20, 2024 19:30
Copy link
Collaborator

@qubvel qubvel left a comment

Choose a reason for hiding this comment

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

Thanks for update, I made a quick look at the architecture design, here is main concern

Resize all FPN output features to 1/4 of the original resolution.
@brianhou0208 brianhou0208 requested a review from qubvel September 22, 2024 08:56
Copy link
Collaborator

@qubvel qubvel left a comment

Choose a reason for hiding this comment

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

Looks great, just one nit and we are ready to merge this!

1. Use `SegmentationHead` for upsampling, set `upsampling=4`
2. Remove the additional variable `out_channels` from `UPerNetDecoder`
3. Fix `SegmentationHead` kernel size to 1
@brianhou0208
Copy link
Contributor Author

I've finished it and fixed a few small issues.

@qubvel
Copy link
Collaborator

qubvel commented Oct 5, 2024

@brianhou0208 Thanks a lot for addressing it!

@qubvel qubvel merged commit dad4b05 into qubvel-org:main Oct 5, 2024
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