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

Gaussian blur #251

Closed
wants to merge 4 commits into from
Closed

Gaussian blur #251

wants to merge 4 commits into from

Conversation

artu1999
Copy link
Contributor

@artu1999 artu1999 commented Apr 1, 2022

Implementation of randomised Gaussian Blur as discussed in #26 and #143, using BaseAugmentationLayer.

Example:

blurred

At the moment, only sigma is randomized. vectorized_map doesn't seem to handle kernel of different sizes when distributing depthwise_conv2d between different threads, as when I tried using random size as well I would get this error:

2022-04-01 10:53:14.692102: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at list_kernels.h:458 : INVALID_ARGUMENT: PartialTensorShape: Incompatible shapes during merge: [3] vs. [2]
Traceback (most recent call last):
File "keras_cv/layers/preprocessing/gaussian_blur_test.py", line 119, in
test.test_on_real_img()
File "keras_cv/layers/preprocessing/gaussian_blur_test.py", line 109, in test_on_real_img
for image in blurred.take(1):
File "/Users/arturosalmi/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 766, in next
return self._next_internal()
File "/Users/arturosalmi/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 752, in _next_internal
output_shapes=self._flat_output_shapes)
File "/Users/arturosalmi/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 3017, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "/Users/arturosalmi/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 7164, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: PartialTensorShape: Incompatible shapes during merge: [3] vs. [2]
[[{{node gaussian_blur/loop_body/range/pfor/TensorListConcatV2}}]] [Op:IteratorGetNext]

@google-cla
Copy link

google-cla bot commented Apr 1, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@LukeWood
Copy link
Contributor

LukeWood commented Apr 1, 2022

Hey @artu1999 thanks for the PR!! Can you accept the CLA? Then we can proceed.

@LukeWood LukeWood closed this Apr 4, 2022
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

Successfully merging this pull request may close these issues.

2 participants