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.
| 464 | |
| 465 | |
| 466 | class 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 | |
| 486 | class TopDownGenerateTarget: |