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

Class NormalizeTensor

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

Normalize the Tensor image (CxHxW), with mean and std. Required key: 'img'. Modifies key: 'img'. Args: mean (list[float]): Mean values of 3 channels. std (list[float]): Std values of 3 channels.

Source from the content-addressed store, hash-verified

464
465
466class NormalizeTensor:
467 """Normalize the Tensor image (CxHxW), with mean and std.
468
469 Required key: 'img'. Modifies key: 'img'.
470
471 Args:
472 mean (list[float]): Mean values of 3 channels.
473 std (list[float]): Std values of 3 channels.
474 """
475
476 def __init__(self, mean, std):
477 self.mean = mean
478 self.std = std
479
480 def __call__(self, results):
481 results['image'] = F.normalize(
482 results['image'], mean=self.mean, std=self.std)
483 return results
484
485
486class TopDownGenerateTarget:

Callers 1

__init__Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected