(a: np.ndarray)
| 254 | |
| 255 | |
| 256 | def normalize01(a: np.ndarray) -> np.ndarray: |
| 257 | mn = float(a.min()) |
| 258 | mx = float(a.max()) |
| 259 | if mx - mn < 1e-8: |
| 260 | return np.zeros_like(a, dtype=np.float32) |
| 261 | return ((a - mn) / (mx - mn)).astype(np.float32) |
| 262 | |
| 263 | |
| 264 | def smooth_box(a: np.ndarray, passes: int) -> np.ndarray: |
no outgoing calls
no test coverage detected