Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Should the grayscale transform come last in the list? #128

Open
diviramon opened this issue Feb 26, 2021 · 2 comments
Open

Should the grayscale transform come last in the list? #128

diviramon opened this issue Feb 26, 2021 · 2 comments

Comments

@diviramon
Copy link

transformList = [Transforms.Grayscale(1)] + transformList

As it is right now, it will through an error when using 1 channel images since they are converted to GrayScale first then a transform on three channels (0.5,0.5,0.5) is applied.

@GarySarwin
Copy link

Try this:

transformList = [Transforms.Grayscale(1)] + transformList[:len(transformList)-1] + [Transforms.Normalize((0.5,),(0.5,))]

@aaroncoyner
Copy link

This fixed it for me: #122 (comment)

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

No branches or pull requests

3 participants