ml_lib/utils/transforms.py
2020-05-20 13:29:16 +02:00

10 lines
261 B
Python

from torchvision.transforms import ToTensor as TorchVisionToTensor
class ToTensor(TorchVisionToTensor):
def __call__(self, pic):
# Make it float .float() == 32bit
tensor = super(ToTensor, self).__call__(pic).float()
return tensor