Open kotekjedi opened 3 years ago
In the previous message, I had opencv_transforms installed directly using pip install opencv_transforms,
I tried to install directly from git, which got me this
Not quite convinced that it's an Opencv-related error. Must be a silly bug in the code.
Tested this out on the transforms
module of my Vision library caer
and didn't receive any error. caer.transforms
is quite similar to this OpenCV implementation of torchvision functions, except that we solely use functions as opposed to classes. You might want to try it out :)
Let me know if you need anything else! -J
@jasmcaus this is not the place to promote your external package.
@kotekjedi I was able to reproduce your issue. However, the issue was that numpy
defaults to int64
. Changing to a uint8
dtype fixes this issue.
Try this:
image = np.random.randint(low=0, high=255, size=(1024,2048, 3)).astype(np.uint8)
resize = transforms.Resize(size=(256,256))
image = resize(image)
I am facing this error while reproducing the example code from https://pypi.org/project/opencv-transforms/.
python - 3.8.5 numpy - 1.19.1 opencv - 4.4.0