(self, img: NdarrayTensor)
| 1632 | self.approx = approx |
| 1633 | |
| 1634 | def __call__(self, img: NdarrayTensor) -> NdarrayTensor: |
| 1635 | img = convert_to_tensor(img, track_meta=get_track_meta()) |
| 1636 | img_t, *_ = convert_data_type(img, torch.Tensor, dtype=torch.float) |
| 1637 | sigma: Sequence[torch.Tensor] | torch.Tensor |
| 1638 | if isinstance(self.sigma, Sequence): |
| 1639 | sigma = [torch.as_tensor(s, device=img_t.device) for s in self.sigma] |
| 1640 | else: |
| 1641 | sigma = torch.as_tensor(self.sigma, device=img_t.device) |
| 1642 | gaussian_filter = GaussianFilter(img_t.ndim - 1, sigma, approx=self.approx) |
| 1643 | out_t: torch.Tensor = gaussian_filter(img_t.unsqueeze(0)).squeeze(0) |
| 1644 | out, *_ = convert_to_dst_type(out_t, dst=img, dtype=out_t.dtype) |
| 1645 | |
| 1646 | return out |
| 1647 | |
| 1648 | |
| 1649 | class RandGaussianSmooth(RandomizableTransform): |
nothing calls this directly
no test coverage detected