(batch: Batch, patch_size: int)
| 69 | |
| 70 | |
| 71 | def patch_crop_batch(batch: Batch, patch_size: int) -> Batch: |
| 72 | _, _, _, h, w = batch.videos.shape |
| 73 | old_shape = (h, w) |
| 74 | new_shape = compute_patch_cropped_shape((h, w), patch_size) |
| 75 | return replace( |
| 76 | batch, |
| 77 | intrinsics=center_crop_intrinsics(batch.intrinsics, old_shape, new_shape), |
| 78 | videos=center_crop_images(batch.videos, new_shape), |
| 79 | ) |
| 80 | |
| 81 | |
| 82 | def get_image_shape( |
no test coverage detected