lightly icon indicating copy to clipboard operation
lightly copied to clipboard

Add RandomFrequenceMask transform

Open guarin opened this issue 1 year ago • 12 comments

See https://github.com/lightly-ai/lightly/issues/1646 for information

guarin avatar Oct 02 '24 07:10 guarin

Hi @guarin , I'm pretty new to open source and would like to contribute to this. I have been looking at the Contributions.md for basic guidelines, where should I go next on this? Also are you on the hacktober's discord? (If it's comfortable with you to disclose that? If I had some doubts, I thought I could contact you their itself)

payo101 avatar Oct 03 '24 16:10 payo101

Hi @payo101, the next steps are: 1) We'll assign the issue to you; 2) You open a pull request as outlined in CONTRIBUTIONS.md. For more information on the implementation details please check out the issue referenced in the description. For reference you can also take a look at the augmentations we have already implemented (see, e.g. random rotation). Could you please quickly confirm if you're interested in working on this?

Also are you on the hacktober's discord? (If it's comfortable with you to disclose that? If I had some doubts, I thought I could contact you their itself)

Forwarding this to @guarin :)

philippmwirth avatar Oct 04 '24 09:10 philippmwirth

Yeah I am interested to work on this

payo101 avatar Oct 04 '24 09:10 payo101

Also are you on the hacktober's discord? (If it's comfortable with you to disclose that? If I had some doubts, I thought I could contact you their itself)

Yes you can find me under the same name :)

We also have a discord for lightly related questions: https://discord.gg/xvNJW94

guarin avatar Oct 04 '24 13:10 guarin

Hi @guarin , So I have 2 doubts to ask

  • Will the input be the RFFT of the Image, or the Image itself? I have been currently working with assuming the former
  • Should the output also return the binary mask that's being applied on the FFT?

payo101 avatar Oct 06 '24 11:10 payo101

Also, I am facing a mypy error while proceeding to commit Screenshot 2024-10-06 235119

After looking into it, all necessary steps that can be done to prevent this has been done, but it's still showing this error, any chance anyone could help me with it?

payo101 avatar Oct 06 '24 18:10 payo101

Also, I am facing a mypy error while proceeding to commit Screenshot 2024-10-06 235119

After looking into it, all necessary steps that can be done to prevent this has been done, but it's still showing this error, any chance anyone could help me with it?

Hey @payo101, it's interesting that this only comes up now. You can fix it by adding an ignore statement:

class RandomResizedCropAndFlip(nn.Module): # type: ignore[misc] # Class cannot subclass "RandomVerticalFlip" (has type "Any")

If you look at the other examples just above, this is exactly how we fixed it previously. Strange that mypy checks on master are passing... Maybe it's also related to mypy version. Can you share which version you're using?

philippmwirth avatar Oct 07 '24 06:10 philippmwirth

it's 1.4.1

payo101 avatar Oct 07 '24 09:10 payo101

it's 1.4.1

Ok, that's correct. Did you manage to fix the problem with the proposed # type: ignore ...?

philippmwirth avatar Oct 07 '24 09:10 philippmwirth

Yeah, it got fixed 😄

payo101 avatar Oct 07 '24 10:10 payo101

Hi @guarin , So I have 2 doubts to ask

  • Will the input be the RFFT of the Image, or the Image itself? I have been currently working with assuming the former
  • Should the output also return the binary mask that's being applied on the FFT?

Could you also clarify on these two doubts also @philippmwirth Also, will the k% which is mentioned for the transform be a user input, I am working under the assumption that it will be?

payo101 avatar Oct 07 '24 10:10 payo101

You can assume the input is the RFFT tensor. No need to return the binary mask.

philippmwirth avatar Oct 07 '24 10:10 philippmwirth

Completed in #1680

guarin avatar Oct 21 '24 07:10 guarin