I’m trying to create my own funcor for use in transformations, but it keeps failing with the error :
**TypeError** : 'Resize' object is not callable
This my example :
import torchvision.transforms.functional as F
class Resize(object):
def __init__(self, size, interpolation):
self.size = size
self.interpolation = interpolation
def __cal__(self, input):
return F.resize(input, self.size, self.interpolation)
to_tensor_f = ToTensor()
import PIL.Image as Image
resize_f = Resize(3, Image.BILINEAR)
numpy_tensor = np.random.rand(2, 3)
result_tensor = to_tensor_f(numpy_tensor)
print(result_tensor)
#resize this tensor!
x=resize_f(result_tensor)
print(x)
Thank you all in advance