-
Notifications
You must be signed in to change notification settings - Fork 615
Added gaussian_blur_op #1450
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
Added gaussian_blur_op #1450
Conversation
@seanpmorgan @gabrieldemarmiesse @WindQAQ @autoih Please provide a review |
@ghosalsattam This is PR requires some more work to get to an acceptable state. I'll work you through the steps:
|
@Squadrick I am trying to use tf.Tensor to find Gaussian Kernel.But when I am using the function assign in a variable of type tf.Variable I am getting the error 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'assign' |
@ghosalsattam Can you post the code that's causing the error. |
Ok |
def findKernel(sigma,kSize,gaussianFilter):
gaussianFilter=tf.Variable(tf.zeros([5,5])) |
@Squadrick Please help with the code I provided above |
Ok I solved it. Thank you for the support and sorry for the inconvenience caused. |
@Squadrick plaese provide a review. |
@seanpmorgan @gabrieldemarmiesse @WindQAQ @autoih @Squadrick Please provide a review |
Fixes Issue #1353 |
@ghosalsattam we usually provide review when all the tests in the CI are passing. Here you have some failed tests. You can look at the logs by clicking on "details". |
Somehow I cannot comment on that thread? Here is what I would like to say:
"I believe @bhack is correct that this could be accomplished with two
1-dimensional convolutions, which would reduce the number of flops.
However, if the kernel is small and the image large, reading the image
twice might slow down the overall computation, compared to using a single
Conv2D call. We should really have a specialized op for separable kernels
like this. (Do we?)"
…On Wed, Apr 29, 2020 at 10:25 AM Alexandre Passos ***@***.***> wrote:
Ah, sorry, I misread the thread.
@rmlarsen <https://github.com/rmlarsen> do you know who understands our
depthwise conv kernels enough to answer this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1450 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEA72DUQWBZTWI4GSSMS2BTRPBPJLANCNFSM4LUXGCNA>
.
|
Correct me if I'm wrong, but from my experience, I think there are (at
least) 3 distinct regimes for separable kernels (assuming a large image):
1. Tiny kernels: Use brute-force conv2d.
2. Medium kernels: Use "brute force" kernel, but take advantage of
separability, one block at a time.
3. Large kernels: Use FFT.
On Wed, Apr 29, 2020 at 10:34 AM Rasmus Munk Larsen <[email protected]>
wrote:
… Somehow I cannot comment on that thread? Here is what I would like to say:
"I believe @bhack is correct that this could be accomplished with two
1-dimensional convolutions, which would reduce the number of flops.
However, if the kernel is small and the image large, reading the image
twice might slow down the overall computation, compared to using a single
Conv2D call. We should really have a specialized op for separable kernels
like this. (Do we?)"
On Wed, Apr 29, 2020 at 10:25 AM Alexandre Passos <
***@***.***> wrote:
> Ah, sorry, I misread the thread.
>
> @rmlarsen <https://github.com/rmlarsen> do you know who understands our
> depthwise conv kernels enough to answer this?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1450 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEA72DUQWBZTWI4GSSMS2BTRPBPJLANCNFSM4LUXGCNA>
> .
>
|
@rmlarsen I don't know if also the device specific knowledge it is going to play a role in the transform stack. |
@rmlarsen P.s. I don't know if we have already this device specific knowledge or we need to waiting for something like a more advanced machine retargetability in MLIR |
Yes, the device will definitely play a role and, if nothing else, determine
where the boundaries of the regimes are.
…On Wed, Apr 29, 2020 at 11:31 AM bhack ***@***.***> wrote:
@rmlarsen <https://github.com/rmlarsen> P.s. I don't know if we have
already this device specific knowledge or we need to waiting for something
like a more advanced machine retargetability in MLIR
<https://llvm.discourse.group/t/rfc-enhancing-machine-retargetability-in-mlir/885>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1450 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEA72DTYKIVGATV6UVTUNWTRPBXAVANCNFSM4LUXGCNA>
.
|
@bhack For now what should I do to this PR in order for it to be brought to merging state? |
@ghosalsattam I think that you could use the 2d kernel here for merging and that you could track this on a |
And for CPU? |
@ghosalsattam I think you can ignore the device and that it is better that |
Ok!!!
…On Thu, 30 Apr 2020 at 00:42, bhack ***@***.***> wrote:
@ghosalsattam <https://github.com/ghosalsattam> I think you can ignore
the device and that it is better that DepthwiseConv2D will have directly
this knowledge instead of having conditions here in the op so it knows how
to propagate down the stack.
In proposal ticket on TF I hope that you could ask to pass the
rank=1/separability arg directly (or something similar to inform it about
the separate filter).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1450 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJMBF2CHLHIFYJ5HJS2QNMTRPB3ZXANCNFSM4LUXGCNA>
.
|
@bhack Can it be merged now? |
You need to wait for a reviewer with write power. |
@WindQAQ Can it be merged now? |
@WindQAQ I have addressed all your changes. Can it be merged now? |
@rmlarsen @alextp The feature request for Tensorflow is at tensorflow/tensorflow#39050. Please close it if you evaluate that it is not relevant enough. |
@bhack According to me this should be implemented in all other conv ops where this situation may arise like along wiith depthwise conv operation- Conv2D, Conv3D,... |
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 again for the contribution.
@ALL I learnt many new things from this contribution and cant wait for having new contributions. Thanx for your support. |
@ghosalsattam Thanks for the contribution! |
* Gaussian Blur op * Adds Average smoothing op * Gaussian Filter * Delete averageSmoothing.py remove averageSmoothing.py * Delete averageSmoothing_test.py * Delete gaussianBlur_ops.py * Delete gaussianBlur_ops_test.py * Delete gaussianBlur_ops_test.py * improved test * improved test * added main * gaussian * test for gaussian Blur * after flake test * python black * Codeowners * BUILD * __init__ * gaussian_blur * ci test * github check * github check * github check * github test * github check * github check * github check * git check * github check * github check * check * check * ci check * check * test * check * test * github check * github check * ci test * github check * github check * github check * github check * github check * Changed the kernel computing technique * github test * github check * github check * github test * github check * Shifted to filters.py * changed codeowners * revert codeowners changes * changed codeowners * codeowners * Changed TO NHWC format * github check * Update filters.py * github check * Github Check * new commit * increased flexibility of kernel_size * added name parameter for the gaussian blur op * changed documentation * update __init__.py * Added 2D convolution Along with sequence of 1D convolution * Added experimental_compile * revert * github check * githun check
* Gaussian Blur op * Adds Average smoothing op * Gaussian Filter * Delete averageSmoothing.py remove averageSmoothing.py * Delete averageSmoothing_test.py * Delete gaussianBlur_ops.py * Delete gaussianBlur_ops_test.py * Delete gaussianBlur_ops_test.py * improved test * improved test * added main * gaussian * test for gaussian Blur * after flake test * python black * Codeowners * BUILD * __init__ * gaussian_blur * ci test * github check * github check * github check * github test * github check * github check * github check * git check * github check * github check * check * check * ci check * check * test * check * test * github check * github check * ci test * github check * github check * github check * github check * github check * Changed the kernel computing technique * github test * github check * github check * github test * github check * Shifted to filters.py * changed codeowners * revert codeowners changes * changed codeowners * codeowners * Changed TO NHWC format * github check * Update filters.py * github check * Github Check * new commit * increased flexibility of kernel_size * added name parameter for the gaussian blur op * changed documentation * update __init__.py * Added 2D convolution Along with sequence of 1D convolution * Added experimental_compile * revert * github check * githun check
This PR is aimed at putting a gaussian blur in an image. It reduces the noise in an image.
See Issue #1333