Comments (12)
In my observation, negative noise-values of the GaussNoise are truncated.
import numpy as np
import albumentations as A
x = np.full((10, 10), 128, dtype=np.uint8)
tr = A.Compose([A.GaussNoise(p=1)]) # for 1.4.8
tr = A.Compose([A.GaussNoise(p=1, noise_scale_factor=1.0)] # for 1.4.9
1.4.8
(tr(image=x)['image'] >= x).all() # -> almost always False
1.4.9
(tr(image=x)['image'] >= x).all() # -> always True
from albumentations.
Sorry, won't be able to test this until next Monday, OOO until then. Maybe the others can confirm. Anyways, thanks for the quick fix! 🥳
from albumentations.
We ran into the same issue, and it broke our CI.
- I think
GaussNoise
is not broken as stated in the PR title, but an additional parameter was introduced with a default value that changes the behavior. Looking at the code, you should be able to get the previous behavior by settingnoise_scale_factor=1.0
. - The release notes do not mention that the default behavior changed (not even how the new parameter is called). Why?
- Can Albumentations switch to semantic versioning? Changing the default behavior is a breaking change which would merit a major version release under semantic versioning, not a patch version release.
from albumentations.
@JulianJvn thanks for this finding! I also checked the release notes and didn't find this. Absolutely agree, semver should be used and reflect that breaking change.
from albumentations.
My bad.
I will put noise_scale_factor=1.0
as default, so that it would work as before.
from albumentations.
We ran into the same issue, and it broke our CI.
- I think
GaussNoise
is not broken as stated in the PR title, but an additional parameter was introduced with a default value that changes the behavior. Looking at the code, you should be able to get the previous behavior by settingnoise_scale_factor=1.0
.- The release notes do not mention that the default behavior changed (not even how the new parameter is called). Why?
- Can Albumentations switch to semantic versioning? Changing the default behavior is a breaking change which would merit a major version release under semantic versioning, not a patch version release.
It is possible, but will require extra effort and attention.
Would you consider becoming a sponsor?
https://github.com/sponsors/albumentations-team
from albumentations.
@daitakahashi thank you. Will look at it asap.
from albumentations.
Made scale_factor=1
as default in #1800
from albumentations.
Here may be the cause. The value gauss
should be a mean == self.mean
array (possibly with some negative values).
>>> tr.transforms[0].get_params_dependent_on_targets({'image':x})
{'gauss': array([[253, 11, 253, 3, 255, 2, 252, 253, 251, 254],
[251, 251, 249, 253, 255, 1, 0, 5, 252, 3],
[255, 1, 3, 9, 6, 249, 0, 1, 254, 11],
[251, 2, 0, 1, 249, 253, 252, 0, 0, 5],
[241, 4, 7, 1, 248, 244, 5, 0, 247, 0],
[ 0, 255, 253, 13, 5, 1, 3, 252, 249, 1],
[252, 5, 0, 0, 0, 246, 240, 4, 253, 2],
[ 3, 5, 253, 7, 2, 251, 2, 252, 255, 250],
[ 0, 2, 253, 16, 2, 5, 3, 3, 4, 9],
[ 0, 254, 5, 17, 249, 254, 12, 255, 7, 8]], dtype=uint8)}
from albumentations.
Yep, it is this casting.
Adding tests
from albumentations.
Fixed in #1801
@voegtlel @daitakahashi @JulianJvn
Could you please verify that things work as expected? Default behavior is generate per pixel and noise is not truncated.
If no other issues will come up with it, I will make a hotfix release 1.4.10
in couple hours.
from albumentations.
Version 1.4.10 with fix for GaussNoise released.
Thanks @voegtlel @JulianJvn and @daitakahashi for help.
from albumentations.
Related Issues (20)
- [Bug] When applying `return_params=True` in Compose, it does not return class names, butintegers, instead
- [Feature request] Add balanced scale to `Affine`
- Request: ability to reject augmented images
- AttributeError: 'Albumentations' object has no attribute 'contains_spatial' HOT 2
- Can't do any data augmentation on my custom dataset in FiftyOne HOT 1
- Environmental variables to disable auto-update seems to be NO_ALBUMENTATIONS_UPDATE but is documented as ALBUMENTATIONS_NO_AUTO_UPDATE HOT 1
- [Benchmark] Add Augmentor to bechmark
- [Bug] Bug in RandomCropNearBBox HOT 1
- Fix available keys
- [it may be a bug but I am not sure] rotating and cropping adding in pixels HOT 4
- keypoint position shifting during image rotation HOT 3
- Data loading does not start when num_workers > 0 in 1.4.10 HOT 4
- [Benchmark] Add transforms from Kornia HOT 1
- [Tech Debt, Speedup] Move to_float to albucore
- ISONoise not working in 1.4.10 HOT 1
- [Bug] Issue in RandomCrop HOT 1
- Coarse Dropout ignores remove_invisible parameter
- [Feature request] Add LetterBox
- Affine rotate shear after the picture frame does not overlap the object HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from albumentations.