Skip to content

Fix Gaussian Blur #1052

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 2 commits into from
Feb 1, 2023
Merged

Conversation

AurelienGauffre
Copy link
Contributor

Fix the Gaussian Blur as detailed in #1051. This is just a quick fix example, feel free to reject this PR and write your own clean implementation, although I would love to help if I can.

In particular, this is probably a classical problem, but I am not sure how to handle cleanly the old parameters of GaussianBlur filter as scale or kernel_size that we don't need anymore with this fix : either one can delete these two parameters, but it does not ensure compatibility with older version of Lightly (if a user happened to use the Gaussian Blur function, this will lead to an issue), or one can leave these two unused parameters as is with default values, resulting in a not very clean implementation having useless parameters (current state of the PR).

One important question would be about using the Gaussian Blur either from PIL or from TorchVision.

@Ra1Nik
Copy link
Contributor

Ra1Nik commented Jan 31, 2023

Hi, awesome PR, really great finding! I launched the benchmarks running your code. I will have the results tomorrow. I will be back to you as soon as the computation is over!

@Ra1Nik
Copy link
Contributor

Ra1Nik commented Feb 1, 2023

I tested the code, and the results are great! Thanks a lot for the finding. You can merge the PR.

We'll stick to PIL images, so we don't need torchvision v0.8.0 as a requirement for lightly. As the next step, we will create an issue to add a deprecation warning, so we will follow your approach. Thanks again!

Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@codecov
Copy link

codecov bot commented Feb 1, 2023

Codecov Report

Base: 88.79% // Head: 88.79% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (f0d9e7a) compared to base (b4fd2b6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1052      +/-   ##
==========================================
- Coverage   88.79%   88.79%   -0.01%     
==========================================
  Files         107      108       +1     
  Lines        5015     5023       +8     
==========================================
+ Hits         4453     4460       +7     
- Misses        562      563       +1     
Impacted Files Coverage Δ
lightly/data/collate.py 94.04% <ø> (ø)
lightly/transforms/gaussian_blur.py 100.00% <100.00%> (ø)
lightly/utils/__init__.py 100.00% <0.00%> (ø)
lightly/utils/scheduler.py 81.81% <0.00%> (ø)
lightly/models/utils.py 80.00% <0.00%> (+0.58%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

3 participants