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

Question regarding smoothing of edges #9

Open
ghpkishore opened this issue Jun 15, 2023 · 3 comments
Open

Question regarding smoothing of edges #9

ghpkishore opened this issue Jun 15, 2023 · 3 comments

Comments

@ghpkishore
Copy link

Hi, I am currently using IS-NET (https://github.com/xuebinqin/DIS) in my workflow. I want to use Matt Anything, however I am facing an issue. The main one being that the edges of the masking are not as smooth as the ones from IS-Net.

Input Image:
InitTest

ISNET Mask:
image

Mask from MAM HF space:
image

I wanted to know how to get the IS-net mask smoothness using MAM. Please assist.

@chrisjuniorli
Copy link
Collaborator

Thanks for posting this question. I think ISNET returns the high-resolution binary mask while MAM returns the continuous alpha channel values between 0 to 1, which may makes the boundary looks not as smoothing as the binary mask. One solution could be adding binarization in the end to MAM, but if you want binary mask as output I guess ISNet may fits your needs better than MAM.

@chrisjuniorli
Copy link
Collaborator

One more thing is that upsampling could return the non-smoothing boundary as well. We resize the image to 1024x1024 to MAM and upsample the final output to original input size. If you use high-res inputs like 2K/4K, which ISNET is designed for, could result in the non-smoothing boundary for MAM's output.

@ghpkishore
Copy link
Author

HI @chrisjuniorli thanks for the reply:

If you use high-res inputs like 2K/4K, which ISNET is designed for, could result in the non-smoothing boundary for MAM's output

My inputs are less than 1024 x 1024.

One solution could be adding binarization in the end to MAM

Can you elaborate on how to add the binarization to the end of MAM. My understanding is that , say get the final pixel values and make everything less than 0.5 as 0 and greater than 0.5 as 1 is extremely naive and might not be great at giving results.

So would appreciate if there is anyway to include better ways to incorporate binarization in MAM.

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

No branches or pull requests

2 participants