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

Grayscale transformations #6

Open
adamxyang opened this issue Aug 25, 2019 · 2 comments
Open

Grayscale transformations #6

adamxyang opened this issue Aug 25, 2019 · 2 comments

Comments

@adamxyang
Copy link

adamxyang commented Aug 25, 2019

Hi, thanks for the great package. I found affine transformations always turn my Grayscale images into three-channel images. Is there any additional parameters that would prevent this and only output one-channel grayscale images?

I simply used the code in Readme:

train_transform = cvtransforms.Compose([
cvtransforms.RandomAffine(degrees=10, translate=(0.1, 0.1), scale=(0.9, 1.1), shear=(-10, 0)),
cvtransforms.ToTensor()
                ])

ToTensor method preserves dimensions but RandomAffine does not.

@hityzy1122
Copy link
Owner

hityzy1122 commented Aug 26, 2019

Hi, thanks for the great package. I found affine transformations always turn my Grayscale images into three-channel images. Is there any additional parameters that would prevent this and only output one-channel grayscale images?

I simply used the code in Readme:

train_transform = cvtransforms.Compose([
cvtransforms.RandomAffine(degrees=10, translate=(0.1, 0.1), scale=(0.9, 1.1), shear=(-10, 0)),
cvtransforms.ToTensor()
                ])

ToTensor method preserves dimensions but RandomAffine does not.

Thank you for pointing out the bugs, I think I have adjust the affine transform and the perspective transform for grayscale image

@adamxyang
Copy link
Author

Thanks for the update! Is that possible to push the change to the public package? I used pip install for the package, it would be great if I can upgrade it using pip.

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

2 participants