MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / Normalize

Class Normalize

mogen/datasets/pipelines/transforms.py:105–124  ·  view source on GitHub ↗

Normalize motion sequences. Args: mean_path (str): Path of mean file. std_path (str): Path of std file.

Source from the content-addressed store, hash-verified

103
104@PIPELINES.register_module()
105class Normalize(object):
106 """Normalize motion sequences.
107
108 Args:
109 mean_path (str): Path of mean file.
110 std_path (str): Path of std file.
111 """
112
113 def __init__(self, mean_path, std_path, eps=1e-9, keys=['motion']):
114 self.mean = np.load(mean_path)
115 self.std = np.load(std_path)
116 self.eps = eps
117 self.keys = keys
118
119 def __call__(self, results):
120 for k in self.keys:
121 motion = results[k]
122 motion = (motion - self.mean) / (self.std + self.eps)
123 results[k] = motion
124 return results

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected