MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / ToUNTensor

Class ToUNTensor

PATH/core/data/transforms/pose_transforms.py:451–463  ·  view source on GitHub ↗

Transform image to Tensor. Required key: 'img'. Modifies key: 'img'. Args: results (dict): contain all information about training.

Source from the content-addressed store, hash-verified

449
450
451class ToUNTensor:
452 """Transform image to Tensor.
453
454 Required key: 'img'. Modifies key: 'img'.
455
456 Args:
457 results (dict): contain all information about training.
458 """
459
460 def __call__(self, results):
461 results['image'] = torch.as_tensor(np.ascontiguousarray(results['image'].transpose(2, 0, 1)))
462 # results['image'] = F.to_tensor(results['image'])
463 return results
464
465
466class NormalizeTensor:

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected