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
Hi,
There is already a piece of code that intercepts the RandomHorizontalFlip and adjusts the bounding "boxes" accordingly. Please may you implement the same for RandomVerticalFlip?
Hi,
There is already a piece of code that intercepts the RandomHorizontalFlip and adjusts the bounding "boxes" accordingly. Please may you implement the same for RandomVerticalFlip?
Like so:
elif isinstance(t, transforms.RandomVerticalFlip): if random.random() < random_vertical_flip: image = transforms.RandomVerticalFlip(1)(image) for idx, box in enumerate(targets['boxes']): # Flip box's y-coordinates box[1] = height - box[1] box[3] = height - box[3] box[[1,3]] = box[[3,1]] targets['boxes'][idx] = box
The text was updated successfully, but these errors were encountered: