Загрузка
torch.Tensor subclass for images with shape [..., C, H, W].
data (tensor-like, PIL.Image.Image) – Any data that can be turned into a tensor with torch.as_tensor() as
well as PIL images.
dtype (torch.dpython:type, optional) – Desired data type. If omitted, will be inferred from
data.
device (torch.device, optional) – Desired device. If omitted and data is a
torch.Tensor, the device is taken from it. Otherwise, the image is constructed on the CPU.
requires_grad (bool, optional) – Whether autograd should record operations. If omitted and
data is a torch.Tensor, the value is taken from it. Otherwise, defaults to False.
Examples using Image:
Transforms v2: End-to-end object detection/segmentation example