Comments (10)
I mean the example in the documentation may not work if we use an ImageOnlyTransform
, e.g., GaussianBlur
, instead of the HorizontalFlip
(note: I haven't tried yet).
from albumentations.
It does not look right to me eigher.
from albumentations.
I encountered it when I compiling an example case of this issue.
This is not OK. Will fix it,
from albumentations.
Thanks.
Applying transforms, without wrapping with Compose, typically leads to enexpected bugs => better to always wrap with compose.
At the same time adding is_check_args
parameter to transforms looks quite doable, and if user knows that they are doing - why not have such functionality?
Will work on this.
from albumentations.
Do you use single transform or inside Compose?
Single transform don`t check keys - just ignores unused keys.
from albumentations.
Ayasyrev is right. I found that I have always wrapped transforms with Compose. So the situation I described in this issue is limited to transforms that are wrapped with Compose. I will update this issue to make sure it.
from albumentations.
By the way, this is a bit unintuitive for me (albumentations 1.4.8).
>>> tr = A.Compose([A.Blur()])
>>> tr.add_targets({'mask2': 'mask'})
>>> out = tr(image=np.zeros((2, 2, 3)), mask2=np.zeros((2, 2, 3)))
Traceback (most recent call last):
...
ValueError: Key mask2 is not in available keys.
>>> tr = A.Compose([A.Flip()])
>>> tr.add_targets({'mask2': 'mask'})
>>> out = tr(image=np.zeros((2, 2, 3)), mask2=np.zeros((2, 2, 3)))
>>>
I encountered it when I compiling an example case of this issue.
from albumentations.
I feel that checking against _available_keys
seems to be too restrictive as _available_keys
depends on transforms inside and key-permissive nature of those transforms.
from albumentations.
By the way, this is a bit unintuitive for me (albumentations 1.4.8).
>>> tr = A.Compose([A.Blur()]) >>> tr.add_targets({'mask2': 'mask'}) >>> out = tr(image=np.zeros((2, 2, 3)), mask2=np.zeros((2, 2, 3))) Traceback (most recent call last): ... ValueError: Key mask2 is not in available keys. >>> tr = A.Compose([A.Flip()]) >>> tr.add_targets({'mask2': 'mask'}) >>> out = tr(image=np.zeros((2, 2, 3)), mask2=np.zeros((2, 2, 3))) >>>I encountered it when I compiling an example case of this issue.
The reason why you get error here - Blur
is ImageOnly
transform, so masks not processed here and add some additional key for mask make not many sense. But as mask is special case, I'll add this possibility.
from albumentations.
@ayasyrev Yes, Blur()
is imageonly, I understand it. I'm concerning a case of trying out several combinations of transformations to a predefined dataset (I often do such experiments, so my concern may be biased). Anyway, I want the transforms not to crash regardless of the data format and algorithms inside.
A.Compose([A.Flip(p=0), A.Blur()])
will work for most of data if we declare key-target pairs by add_targets()
, because Flip
knows mask
, bboxes
, and keypoints
. But this doesn't look nice.
from albumentations.
Related Issues (20)
- Coarse Dropout ignores remove_invisible parameter
- [Feature request] Add LetterBox
- Affine rotate shear after the picture frame does not overlap the object HOT 4
- Yolo bbox conversion produces negative values HOT 3
- Too noisy upgrade warning HOT 12
- AttributeError: 'Compose' object has no attribute 'strict' HOT 5
- How is the pad_cval defined of CropAndPad? HOT 1
- Image and mask augmentations cause error when converting NumPy to PyTorch - [ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported.] HOT 5
- [Benchmark] unable to test the given dataset ILSVRC2012_img_val or owndataset to test the image_benchmark.py with. HOT 2
- Grid-based Elastic Transformation HOT 1
- Root logger conflict with my custom logging structure HOT 2
- HistogramMatching returns wrong image HOT 3
- Mistyping in validation of `ColorJitter` transform HOT 1
- When used for instance segmentation image rotation, points beyond the image boundary are not handled accurately HOT 2
- Enhance augmentation objects with references to a random state. HOT 1
- affine with fit_output set to true does not scale bounding boxes correctly HOT 1
- [Feature Request] Make hardcoded parameter `shadow_intensity = 0.5` a paramater HOT 4
- [Bug] In GridElasticDeform transform last row an column are unaffected HOT 3
- ValidationError while calling ToTensorV2 HOT 2
- Suitable augmentation in Albumentations
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.