MODNet icon indicating copy to clipboard operation
MODNet copied to clipboard

I think the boundary mask is calculated wrong

Open ezio1320 opened this issue 2 years ago • 1 comments

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 avatar Mar 27 '23 13:03 ezio1320

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).

ezio1320 avatar Mar 28 '23 01:03 ezio1320