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

ColorJitter bug #24

Open
shakedpe opened this issue Mar 9, 2023 · 0 comments
Open

ColorJitter bug #24

shakedpe opened this issue Mar 9, 2023 · 0 comments

Comments

@shakedpe
Copy link

shakedpe commented Mar 9, 2023

Hi,
Im looking at the colorjitter code and you apply the transformations like this:

    for transform in transforms:
        img_transformed = np.zeros(img.shape, dtype=np.float32)
        for slice in range(img.shape[0]):
            img_transformed[slice,:,:] = transform(img[slice,:,:].astype(np.float32))
    return img_transformed

But this means you apply a transformation on img and keep zeroing out the img_transform after every transform applied. so basically the output is only the last transformation in the list.
Shouldnt it be something like:

        img_transformed = deepcopy(img)
        for transform in transforms:
            for slice in range(img.shape[0]):
                img_transformed[slice,:,:] = transform(img_transformed [slice,:,:].astype(np.float32))
        return img_transformed

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant