-
Notifications
You must be signed in to change notification settings - Fork 330
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
GridMask implementation with BaseImageAugmentationLayer #159
Conversation
Memory also scales with input resolution, but memory consumption does not come from storing the masks as is. It comes from the I do not have any numbers for increasing image resolution. Let me know if I should conduct some experiments and collect some numbers. But memory will scale with |
Have you tried to |
Running the vectorized implementation with
|
Probably the speed-up is a little bit more as we need to subtract the compile time. |
We are going to lean on the results from #160 to vectorize our KPLs. It looks like I will be contributing an early sample for how to do this in the near future. |
@chjort the examples are ready. Check out |
Thanks @LukeWood, I will begin looking into this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
@qlzh727 Let me know if there are any other changes you would like me to do before this can be merged. |
@chjort great work. Is it possible to showcase some demo output? |
Absolutely. Here are samples from And samples from |
Thanks @chjort |
* temp driver * vectorize mask computation * vectorize mask computation * vectorize mask computation * comment * random rotation and center cropping * finish vectorized gridmask computation * refactor * comment * comment * comments * comments * merge master into branch * initial vectorized layer * initial vectorized layer * debug memory usage * fix tests * remove support for single image * set ratio random in demo * minimize memory by reducing number of simultaneous Logical And operations. * individual ratio for each image when ratio="random" * add vectorized argument * use float32 instead of int32 * use float32 instead of int32 * remove vectorized arg * minor refactor * minor refactor * support single image * refactor coordinates to mask * merge master * optimize bounding box mask generation * add tests * minor refactor * minor refactor * formatting * black * merge with master * WIP. GridMask to BaseImageAugmentationLayer * WIP. GridMask to BaseImageAugmentationLayer * merge master * GridMask to BaseImageAugmentationLayer * Apply changes from review * fix test
* temp driver * vectorize mask computation * vectorize mask computation * vectorize mask computation * comment * random rotation and center cropping * finish vectorized gridmask computation * refactor * comment * comment * comments * comments * merge master into branch * initial vectorized layer * initial vectorized layer * debug memory usage * fix tests * remove support for single image * set ratio random in demo * minimize memory by reducing number of simultaneous Logical And operations. * individual ratio for each image when ratio="random" * add vectorized argument * use float32 instead of int32 * use float32 instead of int32 * remove vectorized arg * minor refactor * minor refactor * support single image * refactor coordinates to mask * merge master * optimize bounding box mask generation * add tests * minor refactor * minor refactor * formatting * black * merge with master * WIP. GridMask to BaseImageAugmentationLayer * WIP. GridMask to BaseImageAugmentationLayer * merge master * GridMask to BaseImageAugmentationLayer * Apply changes from review * fix test
GridMask layer has been updated to use BaseImageAugmentationLayer, which closes #190.
As of now, auto-vectorization of GridMask is not functional using BaseImageAugmentationLayer.
Memory and speed optimizations to
fill_utils.py
are also included in this PR to improve GridMask performance.