ToTensor — mmcv 2.0.0 documentation (original) (raw)
- Docs >
- mmcv.transforms >
- ToTensor
- 以中文阅读
Shortcuts
class mmcv.transforms.ToTensor(keys: Sequence[str])[source]¶
Convert some results to torch.Tensor by given keys.
Required keys:
- all these keys in keys
Modified Keys:
- all these keys in keys
Parameters
keys (Sequence _[_str]) – Keys that need to be converted to Tensor.
transform(results: dict) → dict[source]¶
Transform function to convert data to torch.Tensor.
Parameters
results (dict) – Result dict from loading pipeline.
Returns
keys in results will be updated.
Return type