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

I think the boundary mask is calculated wrong #209

Open
ezio1320 opened this issue Mar 27, 2023 · 1 comment
Open

I think the boundary mask is calculated wrong #209

ezio1320 opened this issue Mar 27, 2023 · 1 comment

Comments

@ezio1320
Copy link

hello,zhanghan:
Modnet is a exciting work in matting research, and your code is helpful a lot. Thank you !
In the process of using your code, I found that there are some problems with the calculation of the bound mask.
In trainer.py , Line 146. the mask calculated as follow: boundaries = (trimap < 0.5) + (trimap > 0.5)

I think the "boundary" means the unknown area of trimap from the paper and literally. So, boundaries = (trimap==0.5)
Which is right? Does anyone else have same question?

@ezio1320
Copy link
Author

hello,zhanghan: Modnet is a exciting work in matting research, and your code is helpful a lot. Thank you ! In the process of using your code, I found that there are some problems with the calculation of the bound mask. In trainer.py , Line 146. the mask calculated as follow: boundaries = (trimap < 0.5) + (trimap > 0.5)

I think the "boundary" means the unknown area of trimap from the paper and literally. So, boundaries = (trimap==0.5) Which is right? Does anyone else have same question?

I tried to modify the boundaries = (trimap==0.5), the performance is bad!
Finally, I find you are right. Combine the following:
pred_boundary_detail = torch.where(boundaries, trimap, pred_detail). That 's right.The variable name ‘boundaries’ confuses me.

If boundaries = (trimap==0.5), pred_boundary_detail = torch.where(boundaries ,pred_detail, trimap).

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

1 participant