apply the scaling and gamma curve. rgb: (h, w, 3)
(rgb: torch.Tensor, gamma: float, scale: float)
| 351 | |
| 352 | @staticmethod |
| 353 | def apply_gamma(rgb: torch.Tensor, gamma: float, scale: float) -> torch.Tensor: |
| 354 | """apply the scaling and gamma curve. |
| 355 | rgb: (h, w, 3) |
| 356 | """ |
| 357 | if scale is None: |
| 358 | return rgb |
| 359 | |
| 360 | rgb = (scale * rgb).clamp(min=0) ** gamma |
| 361 | rgb = rgb.clamp(min=0, max=1.) |
| 362 | return rgb |
| 363 | |
| 364 | def _get_geometry_hdf5_filename( |
| 365 | self, |