Statistical_Classifiers/inference_statistical_models.py
def toTensor(**kwargs):
    image = kwargs['image']
    'will convert image and label from numpy to torch tensor'
    # swap color axis because
    # numpy image: H x W x C
    # torch image: C X H X W
    # image = image.transpose((2, 0, 1))
    return torch.from_numpy(np.nan_to_num(image)).float()
will convert image and label from numpy to torch tensor
will convert image and label from numpy to torch tensor
will convert image and label from numpy to torch tensor
def toTensor(**kwargs):
    image = kwargs['image']
    return torch.from_numpy(np.nan_to_num(image)).float()
def toTensor ( ** kwargs ) : image = kwargs [ 'image' ] return torch . from_numpy ( np . nan_to_num ( image ) ) . float ( )
will convert image and label from numpy to torch tensor
will convert image and label from numpy to torch tensor
'will convert image and label from numpy to torch tensor' # swap color axis because # numpy image: H x W x C # torch image: C X H X W # image = image.transpose((2, 0, 1))