Skip to content

Conversation

@Mr-Neutr0n
Copy link

Bug

In CutMix, the bounding box computation swaps height and width dimensions — height is computed from the width extent and vice versa, leading to incorrectly shaped cutout regions.

The _rand_bbox function declares parameters as (W, H) but callers pass (input.shape[2], input.shape[3]) which is (H, W). This causes cut_w to be computed from the height dimension and cut_h from the width dimension, and the clipping bounds to use the wrong spatial extent.

Fix

Corrected the parameter order in _rand_bbox from (W, H) to (H, W) so that it matches the call sites. Also fixed the corresponding keyword arguments in the test.

@Mr-Neutr0n Mr-Neutr0n requested a review from a team as a code owner February 11, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant