You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Center cropping shifts images after odd-sized centered padding #133
Reproduced on master at ffb65074b39b67e1a686d1348f2d461c7ff3ab45.
center_crop subtracts separately rounded centers to compute its starting position. For an even-sized input and odd target, this selects the bottom/right alignment, whereas pad_to_size puts extra padding on the bottom/right. Padding then cropping can therefore lose original pixels.
Prepared tests cover parity combinations, channel-first/channel-last data, batches, eager/JIT execution, exact round-trip gradients and the combined crop-or-pad API. Oversized target dimensions retain the existing no-op cropping behavior. This does not overlap the Gaussian-blur changes in PRs #119 and #131.
Activity