ZHKKKe / MODNet

A Trimap-Free Portrait Matting Solution in Real Time [AAAI 2022]
Apache License 2.0
3.84k stars 636 forks source link

Trimap data is necessary? #72

Closed andy910389 closed 3 years ago

andy910389 commented 3 years ago

Hello, Thanks for sharing this outstanding research. After reading the training code, I found that trimap data seems to be necessary as a input. " supervised_training_iter(modnet, optimizer, image, trimap, gt_matte)" Howerver, I note that the MODnet is a trimap-free model for portrait matting.

Please help me that how I can modify the code when I don't have trimap data. Or may you tell me how can I obtain the trimap from a annotated image? Thanks a lot.

ZHKKKe commented 3 years ago

Hi, thanks for your attention.

The trimap is used to calculate the detail loss (during training). It is not the input of the model. If you do not have the trimap, please create it from the ground truth by using dilate and erode operation.