Shortcuts

ToTensor

class mmedit.datasets.transforms.ToTensor(keys, to_float32=True)[source]

Convert some values in results dict to torch.Tensor type in data loader pipeline.

Parameters
  • keys (Sequence[str]) – Required keys to be converted.

  • to_float32 (bool) – Whether convert tensors of images to float32. Default: True.

transform(results)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict containing the processed data and information.

Return type

dict

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.