opencv_transforms_torchvision
opencv_transforms_torchvision copied to clipboard
Grayscale transformations
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.
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 butRandomAffine
does not.
Thank you for pointing out the bugs, I think I have adjust the affine transform and the perspective transform for grayscale image
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.