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

[Bug] When applying return_params=True in Compose, it does not return class names, butintegers, instead #1786

Open
ternaus opened this issue Jun 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ternaus
Copy link
Collaborator

ternaus commented Jun 11, 2024

transform = A.Compose([
        A.D4(),
        A.GaussNoise(),
        A.OneOf([
            A.MotionBlur(p=0.2),
            A.MedianBlur(blur_limit=3, p=0.1),
            A.Blur(blur_limit=3, p=0.1),
        ], p=0.2),
        A.Affine(translate_percent=0.0625, scale=(0.8, 1.2), rotate=(-45, 45), p=0.2),
        A.OneOf([
            A.OpticalDistortion(p=0.3),
            A.GridDistortion(p=0.1)
        ], p=0.2),
        A.OneOf([
            A.CLAHE(clip_limit=2),
            A.RandomBrightnessContrast(),
        ], p=0.3),
        A.HueSaturationValue(p=0.3),
], p=1, save_key="applied_params", return_params=True)

image = np.random.randint(0, 255, size=(224, 224, 3)).astype(np.uint8)

transformed = transform(image=image)

=>

OrderedDict([(5510137792, {'group_element': 'v'}),
             (5508965472, {'k': -0.010548435454166227, 'dx': 0, 'dy': 0}),
             (5510136976, {'clip_limit': 1.8016268364914576})])
@ternaus ternaus added the bug Something isn't working label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant