jbohnslav / opencv_transforms

OpenCV implementation of Torchvision's image augmentations
MIT License
375 stars 46 forks source link

transforms.Resize Seems to Not Work With 'int' #8

Closed Huud closed 4 years ago

Huud commented 4 years ago

Not sure if I'm doing something wrong, but this gives an error: "TypeError: 'int' object is not iterable"

transformations = transforms.Compose([
    transforms.Resize(255),
    # some other transforms
])
Huud commented 4 years ago

Ok, this tuple is breaking the function when using an int, and it is not in the original pytorch's transforms.py which just has "self.size = size":

https://github.com/jbohnslav/opencv_transforms/blob/620f1f4881173faa0fc8f884087ee20359754765/opencv_transforms/transforms.py#L126

jbohnslav commented 4 years ago

Thanks for your help! Fixed with #29c6e35.