Normalize the video clip by mean subtraction and division by standard deviation Args: mean (3-tuple): pixel RGB mean std (3-tuple): pixel RGB standard deviation inplace (boolean): whether do in-place normalization
| 376 | |
| 377 | |
| 378 | class NormalizeVideo: |
| 379 | """ |
| 380 | Normalize the video clip by mean subtraction and division by standard deviation |
| 381 | Args: |
| 382 | mean (3-tuple): pixel RGB mean |
| 383 | std (3-tuple): pixel RGB standard deviation |
| 384 | inplace (boolean): whether do in-place normalization |
| 385 | """ |
| 386 | |
| 387 | def __init__(self, mean, std, inplace=False): |
| 388 | self.mean = mean |
| 389 | self.std = std |
| 390 | self.inplace = inplace |
| 391 | |
| 392 | def __call__(self, clip): |
| 393 | """ |
| 394 | Args: |
| 395 | clip (torch.tensor): video clip must be normalized. Size is (C, T, H, W) |
| 396 | """ |
| 397 | return normalize(clip, self.mean, self.std, self.inplace) |
| 398 | |
| 399 | def __repr__(self) -> str: |
| 400 | return f"{self.__class__.__name__}(mean={self.mean}, std={self.std}, inplace={self.inplace})" |
| 401 | |
| 402 | |
| 403 | class ToTensorVideo: |
nothing calls this directly
no outgoing calls
no test coverage detected