yucornetto / MGMatting

This repository includes the official project of Mask Guided (MG) Matting, presented in our paper: Mask Guided Matting via Progressive Refinement Network
Other
331 stars 46 forks source link

Why the uncertainty is 1/255? #40

Open baorina opened 1 year ago

baorina commented 1 year ago

Hi Qihang,

I have a question about uncertainty region computation. Why is pred<[1/255.0] as the uncertain region? How do you choose this value?

def get_unknown_tensor_from_pred(pred, rand_width=30, train_mode=True):

pred: N, 1 ,H, W

N, C, H, W = pred.shape

pred = pred.data.cpu().numpy()
uncertain_area = np.ones_like(pred, dtype=np.uint8)
uncertain_area[pred<1.0/255.0] = 0
uncertain_area[pred>1-1.0/255.0] = 0