(
shape: tuple[int, int],
patch_size: int,
)
| 28 | |
| 29 | |
| 30 | def compute_patch_cropped_shape( |
| 31 | shape: tuple[int, int], |
| 32 | patch_size: int, |
| 33 | ) -> tuple[int, int]: |
| 34 | h, w = shape |
| 35 | |
| 36 | h_new = (h // patch_size) * patch_size |
| 37 | w_new = (w // patch_size) * patch_size |
| 38 | |
| 39 | return h_new, w_new |
| 40 | |
| 41 | |
| 42 | def center_crop_images( |
no outgoing calls
no test coverage detected