Closed FinnChou closed 3 years ago
matte_compositional_loss seem to has same problem
I think it should be
matte_compositional_loss = F.l1_loss(image * pred_matte, image * gt_matte) \
+ 4.0 * F.l1_loss(image * pred_boundary_matte, image * gt_detail)
right?
Hi, thanks for your attentions.
Nope. In our code, gt_detail
is the same as gt_matte
. The foreground and the background regions in pred_boundary_matte
are the same as trimap
, i.e., the same as gt_matte
. Therefore, the loss term F.l1_loss(image * pred_boundary_matte, image * gt_detail)
is only be calculated on the boundary regions.
Thanks for your reply!
https://github.com/ZHKKKe/MODNet/blob/44667be551eff6427e774b60e3b251f90b9dac61/src/trainer.py#L162
calculate matte boundary (or detail) Loss value, we should using pred_boundary_matte and gt_detail (Not gt_matte) , right?
https://github.com/ZHKKKe/MODNet/blob/44667be551eff6427e774b60e3b251f90b9dac61/src/trainer.py#L156 https://github.com/ZHKKKe/MODNet/blob/44667be551eff6427e774b60e3b251f90b9dac61/src/trainer.py#L161