MCPcopy Create free account
hub / github.com/dcharatan/flowmap / patch_crop_batch

Function patch_crop_batch

flowmap/misc/cropping.py:71–79  ·  view source on GitHub ↗
(batch: Batch, patch_size: int)

Source from the content-addressed store, hash-verified

69
70
71def 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
82def get_image_shape(

Callers 2

Calls 3

center_crop_intrinsicsFunction · 0.85
center_crop_imagesFunction · 0.85

Tested by

no test coverage detected