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

[Feature] nnUNet-style Gaussian Noise and Blur #2373

Merged
merged 8 commits into from
Jan 2, 2023

Conversation

blueyo0
Copy link
Contributor

@blueyo0 blueyo0 commented Dec 3, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

implement nnUNet-style Gaussian Noise and Blur

Modification

Please briefly describe what modification is made in this PR.

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Base: 83.57% // Head: 83.61% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (976c460) compared to base (6eb1a95).
Patch coverage: 89.06% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2373      +/-   ##
===========================================
+ Coverage    83.57%   83.61%   +0.04%     
===========================================
  Files          144      144              
  Lines         8238     8302      +64     
  Branches      1226     1237      +11     
===========================================
+ Hits          6885     6942      +57     
- Misses        1160     1161       +1     
- Partials       193      199       +6     
Flag Coverage Δ
unittests 83.61% <89.06%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
mmseg/datasets/__init__.py 100.00% <ø> (ø)
mmseg/datasets/transforms/__init__.py 100.00% <ø> (ø)
mmseg/datasets/transforms/transforms.py 94.56% <89.06%> (-0.68%) ⬇️

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.

@xiexinch
Copy link
Collaborator

xiexinch commented Dec 5, 2022

Hi @blueyo0,
Thanks for your contribution, please fix the lint error. https://github.com/open-mmlab/mmsegmentation/blob/master/.github/CONTRIBUTING.md

Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

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

please add some ut for BioMedicalGaussianBlur

mmseg/datasets/transforms/transforms.py Outdated Show resolved Hide resolved
mmseg/datasets/transforms/transforms.py Outdated Show resolved Hide resolved
# if `self.different_sigma_per_channel` is True,
# re-generate random sigma for each channel
if (sigma is None or self.different_sigma_per_channel):
if (not self.different_sigma_per_axis):
Copy link
Collaborator

Choose a reason for hiding this comment

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

From this implementation, only when self.different_sigma_per_axis is True, it will generate different sigma for each channels along Z axis?

However, different_sigma_per_axis is not working for the function described in docstring, it works as different_sigma_per_channel

different_sigma_per_axis (bool): whether to use different
            sigma for axis X and Y of the image. Default to True.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here are some mistakes in this docstring. Actually, different_sigma_per_axis controls axis X, Y, Z, and different_sigma_per_channel controls axis N. The docstring is corrected now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a little question at L1657-1659, If different_sigma_per_axis is True, it will generate different sigma along Z? not X Y Z?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry I got it, it generates sigma for data_sample.shape[1:], I just ignore :

Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

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

LGTM

@MeowZheng MeowZheng merged commit 26f3df7 into open-mmlab:dev-1.x Jan 2, 2023
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* add UniPC scheduler

* add the return type to the functions

* code quality check

* add tests

* finish docs

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
## Motivation

implement nnUNet-style Gaussian Noise and Blur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants