How can I rotate random degree in 4D tensor (B,C,H,W)? Thanks
4D tensor, not PIL.Image.
I typically use scipy’s rotate function:
Unfortunately it’s not very fast and you have to apply it on a numpy tensor, i.e. before you convert it to a pytorch tensor.
What about this: