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 fix #57

Merged
merged 1 commit into from
Jun 9, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 8, 2020

This change seems to work for me! I've also tried it with the TrainingGenerator and it works fine. Right now only the images and keypoints are being transformed, whereas the augmenters Flipud/Fliplr also transform bounding boxes/heatmaps/etc. If that's necessary, one can easily add it using the same format as here.

@jgraving jgraving self-assigned this May 12, 2020
@stale
Copy link

stale bot commented May 19, 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 19, 2020
@jgraving jgraving added the bug Something isn't working label May 25, 2020
@stale stale bot removed the stale Issue has been inactive for 7 days label May 25, 2020
@jgraving jgraving merged commit cecdb0c into jgraving:master Jun 9, 2020
Selmaan added a commit to Selmaan/DeepPoseKit that referenced this pull request Aug 25, 2020
@eduramiba
Copy link
Contributor

eduramiba commented Oct 15, 2020

Just in case this is useful for someone: I had to revert these changes in my local copy, since they lower my models accuracy and confidence significantly.

Not sure why, though.

@ghost
Copy link
Author

ghost commented Oct 15, 2020

Hmm... I briefly looked back at the changes I made and the errors people are experiencing have to be a result of the change from methods _augment_images and _augment_keypoints to _augment_batch_, which is the preferred way of making custom augmenters now apparently, see this. Perhaps it's incompatible with an older version of imgaug (before 0.4.0). @eduramiba what version are you using?

It'll be an easy fix to separate augment_batch back into the two methods, if that's the issue.

@eduramiba
Copy link
Contributor

Hi @iuls

I tried this with imgaug 0.4.0

@ghost
Copy link
Author

ghost commented Oct 15, 2020

Interesting... so are you getting a different error than this?

@eduramiba
Copy link
Contributor

I am not getting any error, just worse results, always reproducible.
Maybe it's only with my dataset. Does it happen with yours?

Thanks

@ghost
Copy link
Author

ghost commented Oct 15, 2020

I honestly don't remember since I was using this repo a while ago now, but I thought I was getting similar results. You probably already tried this, but I wonder if you use the augmenter to flip some images and plot the keypoints, do you see any discrepancies there?

@eduramiba
Copy link
Contributor

Hi,

In my training script, I visualize some images before the training starts so I can check that things look right and keypoints are well placed, and they do look right with both versions. That's the strange thing....

So maybe it works the same for most cases but not some edge cases.

@ghost
Copy link
Author

ghost commented Oct 15, 2020

That's weird... In terms of transforming the actual keypoint locations I don't think I made any changes to the old code. This change was just supposed to provide support for both left-right and up-down flips in one class. I'll investigate some more!

@eduramiba
Copy link
Contributor

Thanks!

If it helps, I am doing this:

augmenter.append(FlipAxis(data_generator, axis=0, p=0.5))  # flip image up-down
augmenter.append(FlipAxis(data_generator, axis=1, p=0.5))  # flip image left-right 

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

Successfully merging this pull request may close these issues.

3 participants