Skip to content

Transforms (pytorch.transforms)

ToTensor

Convert image and mask to torch.Tensor and divide by 255 if image or mask are uint8 type. WARNING! Please use this with care and look into sources before usage.

Parameters:

Name Type Description Default
num_classes int

only for segmentation

required
sigmoid bool

only for segmentation, transform mask to LongTensor or not.

required
normalize dict

dict with keys [mean, std] to pass it into torchvision.normalize

required

ToTensorV2

Convert image and mask to torch.Tensor.