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

FlipAxis only flipping up-down? #53

Open
ghost opened this issue Apr 28, 2020 · 5 comments
Open

FlipAxis only flipping up-down? #53

ghost opened this issue Apr 28, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 28, 2020

Hi!
I'm trying to use the FlipAxis augmenter to flip images left-right but even setting the axis=1, I still get images flipped up-down. I simply did:

augmenter = FlipAxis(generator, axis=1)
flip_image, flip_keypoints = augmenter(images=image, keypoints=keypoints)

I noticed that if I change the parent class of FlipAxis from iaa.Flipud to iaa.Fliplr, then I only get images flipping left-right, regardless of axis specified. I didn't investigate any further than that and I'm not really familiar with the imgaug library. Any thoughts?

Thanks!

@stale
Copy link

stale bot commented May 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Issue has been inactive for 7 days label May 5, 2020
@jgraving jgraving added bug Something isn't working and removed stale Issue has been inactive for 7 days labels May 6, 2020
@jgraving
Copy link
Owner

jgraving commented May 6, 2020

Hmmm... I guess the easiest thing to do would be to have separate Flipud and Fliplr augmenters that subclass the imgaug version. I'd welcome a PR if you want to work on it, or I can do it myself at some point.

@ghost
Copy link
Author

ghost commented May 7, 2020

I wouldn't mind working on it, but it seems that the Flipud and Fliplr augmenters already have the functionality you'd want them to have - since they can handle keypoints. For example, one can directly do:
aug = iaa.Fliplr()
flip_image, flip_keypoints = aug(images=image, keypoints=keypoints)
or see this example. Maybe there's some other reason to have a built-in augmenter?

The other option could be to have FlipAxis subclass meta.Augmenters (like Flipud/Fliplr), and just have an axis attribute. If you think this is the better idea, I can try to implement it.

@jgraving
Copy link
Owner

jgraving commented May 8, 2020

but it seems that the Flipud and Fliplr augmenters already have the functionality you'd want them to have

They flip the keypoint locations, but not the labels/ordering of the body parts in the array, which is why we subclassed a custom version.

The other option could be to have FlipAxis subclass meta.Augmenters (like Flipud/Fliplr), and just have an axis attribute. If you think this is the better idea, I can try to implement it.

This would be preferable for simplicity, but whatever is easiest to implement. I'd be happy to accept a PR, as I probably won't have much time to work on this for awhile.

@ghost
Copy link
Author

ghost commented May 8, 2020

Ah, that makes sense! I'll submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant