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

Add GaussianMixtureMask transform #1661

Open
Tracked by #1646
guarin opened this issue Oct 2, 2024 · 13 comments · May be fixed by #1692
Open
Tracked by #1646

Add GaussianMixtureMask transform #1661

guarin opened this issue Oct 2, 2024 · 13 comments · May be fixed by #1692

Comments

@guarin
Copy link
Contributor

guarin commented Oct 2, 2024

See #1646 for information

@eleensmathew
Copy link

Hi can I work on this? Also can you mention more details about the issue?

@guarin
Copy link
Contributor Author

guarin commented Oct 2, 2024

Yes of course :) Give me one sec to add some more info.

@guarin
Copy link
Contributor Author

guarin commented Oct 8, 2024

Hi @eleensmathew did you already have time to look into this?

@eleensmathew
Copy link

Sorry but i became busy. Feel free to unassign me from this issue.

@snehilchatterjee
Copy link
Contributor

Hello this actually looks a little interesting. Am I correct in assuming that we have to implement this one ourself ?

@guarin
Copy link
Contributor Author

guarin commented Oct 8, 2024

Yes I could not find any other implementation. From the paper:
Screenshot 2024-10-08 at 16 24 53

@snehilchatterjee
Copy link
Contributor

Then I'd like to work on this. But is it okay if I take my time with this because I am going to be having my exams soon ?

@guarin
Copy link
Contributor Author

guarin commented Oct 8, 2024

Of course, no problem

@snehilchatterjee
Copy link
Contributor

Hey @guarin
This is the result I am getting for the following snippet. I think this is looks very similar to what they have in the paper. This is for c=20..As we decrease c the image get more and more blurry.

def gaussian_kernel(size, sigma, center, device='cpu'):
    u, v = torch.meshgrid(torch.arange(0, size[0], device=device), torch.arange(0, size[1], device=device))
    u0, v0 = center
    gaussian = torch.exp(- ((u - u0) ** 2 / (2 * sigma[0] ** 2) + (v - v0) ** 2 / (2 * sigma[1] ** 2)))
    return gaussian

image

From the paper:
image

@JanumalaAkhilendra
Copy link

I would Like to work on this issue , if it is not assigned to anyone .
Thank you :)

@guarin
Copy link
Contributor Author

guarin commented Oct 9, 2024

@snehilchatterjee this looks great! Do you have time to create a PR for it? And do you have examples of the image getting blurrier with increasing augmentation strength? Then we could check if it really is the same as in the paper.

@JanumalaAkhilendra let's check if @snehilchatterjee would like to create the PR as he has already been working on the issue. We also have many other good first issues: https://github.com/lightly-ai/lightly/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22

@snehilchatterjee
Copy link
Contributor

Yes I will create a PR for it soon. And I will also send some example images shortly.

@snehilchatterjee
Copy link
Contributor

Hi @guarin, during further testing, I noticed that the mask generated by my approach doesn’t match the one produced by their method. Additionally, my results appear to be darker. I will investigate this issue further and get back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants