Normalize motion sequences. Args: mean_path (str): Path of mean file. std_path (str): Path of std file.
| 103 | |
| 104 | @PIPELINES.register_module() |
| 105 | class 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 |
nothing calls this directly
no outgoing calls
no test coverage detected