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

Is there any way to apply augmentation to only the bounding box area? #394

Closed
ydixon opened this issue Aug 23, 2019 · 3 comments
Closed

Comments

@ydixon
Copy link

ydixon commented Aug 23, 2019

I took a look at writing custom augmenters.
It seems both _augment_images() and _augment_keypoints have access to images and keypoints separately.
So I can't read a keypoint(bounding box) and perform augmentation on the image(let's just say I want to assign gray pixels to the entire bounding box area).
Is there any recommended way to approach this problem?

@aleju
Copy link
Owner

aleju commented Aug 24, 2019

This is currently a shortcoming of the library. Augmentations where one type of input data (images, heatmaps, segmentation maps, keypoints, bounding boxes, polygons, line strings) requires information of another type are not possible. It is planned to be changed at some point by giving more control to augment(), but right now such augmentations have to be handled outside of the library.

@ydixon
Copy link
Author

ydixon commented Aug 27, 2019

Thanks for the quick response!

@ydixon ydixon closed this as completed Aug 27, 2019
@aleju
Copy link
Owner

aleju commented Jan 23, 2020

For future users finding the issue: This is now possible since PR #556 using BlendAlphaBoundingBoxes(foreground=child_augmenters). Currently only in master, but will be in the next release (0.4.0). Requires to augment both images and bounding boxes in a single function call, e.g. using BlendAlphaBoundingBoxes(...)(images=<array>, bounding_boxes=<bbs>).

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

No branches or pull requests

2 participants