Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please include RandomVerticalFlip transformation in Dataset.__getitem__ function #124

Open
iancoetzer opened this issue Dec 12, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@iancoetzer
Copy link

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

@iancoetzer iancoetzer added the enhancement New feature or request label Dec 12, 2022
@iancoetzer
Copy link
Author

Dataset.txt
here is a full listing of how I had to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant