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)
- opencv-python-headless continues to be installed despite meeting MIN_OPENCV_VERSION with opencv-python HOT 7
- [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
- GaussNoise broken in 1.4.9 HOT 12
- 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
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.