vis4d.data.transforms.to_tensor

ToTensor transformation.

Classes

ToTensor(*[, in_keys, out_keys, sensors, ...])

Transform all entries in a list of DataDict from numpy to torch.

class ToTensor(*, in_keys=['data'], out_keys=['data'], sensors=None, same_on_batch=True, **kwargs)[source]

Transform all entries in a list of DataDict from numpy to torch.

Note that we reshape K.images from NHWC to NCHW.

__call__(batch)[source]

Transform all entries to tensor.

Return type:

list[Dict[str, Any]]