Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation of randomised Gaussian Blur as discussed in #26 and #143, using BaseAugmentationLayer.
Example:
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]