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

U-net implementation #247

Merged
merged 8 commits into from
Sep 27, 2020
Merged

U-net implementation #247

merged 8 commits into from
Sep 27, 2020

Conversation

annikabrundyn
Copy link
Contributor

@annikabrundyn annikabrundyn commented Sep 23, 2020

Adapting this model from an example in the Lightning repo.

Needs to be tested on Kitti dataset which I've submitted a separate PR for.

@pep8speaks
Copy link

pep8speaks commented Sep 23, 2020

Hello @annikabrundyn! Thanks for updating this PR.

Line 2:45: W292 no newline at end of file

Line 56:1: W391 blank line at end of file

Comment last updated at 2020-09-25 00:26:33 UTC

@codecov
Copy link

codecov bot commented Sep 23, 2020

Codecov Report

Merging #247 into master will increase coverage by 0.31%.
The diff coverage is 98.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #247      +/-   ##
==========================================
+ Coverage   88.31%   88.63%   +0.31%     
==========================================
  Files          70       72       +2     
  Lines        3407     3538     +131     
==========================================
+ Hits         3009     3136     +127     
- Misses        398      402       +4     
Flag Coverage Δ
#cpu 32.35% <33.33%> (-0.27%) ⬇️
#pytest 32.35% <33.33%> (-0.27%) ⬇️
#unittests 87.90% <98.14%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pl_bolts/models/vision/unet.py 98.03% <98.03%> (ø)
pl_bolts/datamodules/__init__.py 100.00% <100.00%> (ø)
pl_bolts/models/__init__.py 100.00% <100.00%> (ø)
pl_bolts/models/vision/__init__.py 100.00% <100.00%> (ø)
pl_bolts/utils/arguments.py 96.15% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2cdad7...a3d4991. Read the comment docs.

@mergify mergify bot requested a review from Borda September 23, 2020 01:16
@annikabrundyn annikabrundyn marked this pull request as draft September 23, 2020 02:30
@annikabrundyn annikabrundyn marked this pull request as ready for review September 23, 2020 18:59
@annikabrundyn annikabrundyn changed the title WIP: U-net implementation U-net implementation Sep 23, 2020
@oke-aditya
Copy link
Contributor

Very Nice! U-Net was one of the major models.
U-Net can do semantic segmentation as well as work as convolutional autoencoder.

So where does this model exactly go into? Into pl_bolts.models.segmentation or pl_bolts.models.autoencoders
or simply superuseful models go to pl_bolts.models.vision

The original paper introduced this for medical imaging using semantic segmentation. So it is well known for this.

There are weights available for torch hub as well. Here is the repo. This has an implementation of dice loss as well. I'm unsure if it is available in bolts/lightning, and might be good to support.

The implementation is done is very very nice.

@Borda Borda added the enhancement New feature or request label Sep 24, 2020
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

can we pls add simple tests for this U-Net?

@annikabrundyn
Copy link
Contributor Author

can we pls add simple tests for this U-Net?

Yes! Will add simple tests for U-net today. I've also got the segmentation model that uses U-net as backbone and Kitti datamodule that we can add once this is merged.

@Borda
Copy link
Member

Borda commented Sep 24, 2020

I've also got the segmentation model that uses U-net as backbone and Kitti datamodule that we can add once this is merged.

cool, then we could upload the weights to S3 :]

@annikabrundyn
Copy link
Contributor Author

can we pls add simple tests for this U-Net?

I've added a super simple test just to check that the forward gives the expected shape. Once we merge the Kitti datamodule, I'll add the segmentation model (which uses this Unet architecture) and a test to check it's performance on the dataset

Let me know if you'd like me to add any other tests!

@annikabrundyn
Copy link
Contributor Author

So where does this model exactly go into? Into pl_bolts.models.segmentation or pl_bolts.models.autoencoders
or simply superuseful models go to pl_bolts.models.vision

This is a good question - this is basically just the UNet architecture so I'm adding a semantic segmentation model that uses this as a backbone. But yes - it's a useful model for lots of different applications so also wasn't sure where exactly it belongs! And thanks Aditya 😄

@Borda Borda self-requested a review September 25, 2020 05:33
@williamFalcon williamFalcon merged commit 72e8be3 into master Sep 27, 2020
@Borda Borda deleted the unet branch October 13, 2020 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants