BiSeNet icon indicating copy to clipboard operation
BiSeNet copied to clipboard

Why does the loss function ignore the tag of 255.

Open yeyuxmf opened this issue 5 years ago • 5 comments

@CoinCheung Why does the loss function ignore the tag of 255. I look at the data. The label of 255 may be various objects, and each image is almost different. Why, please?

yeyuxmf avatar May 29 '20 09:05 yeyuxmf

That is the requirement of the dataset, you may check here for the category mapping.

CoinCheung avatar May 29 '20 09:05 CoinCheung

@CoinCheung Still do not understand, why there are so strange requirements. Why did he do it?

yeyuxmf avatar May 29 '20 09:05 yeyuxmf

There are 30+ categories in the original image, but we only use 19 of them to train and do evaluation. Some of the original 30+ categories are thus mapped to 19 categories, and the others are neglected. We do not need to care about the neglected pixels in the images in the training process, so we do not consider them when we compute the loss. In this way, the neglected pixels have no influence on the gradient and behaves like 'ignored'.

CoinCheung avatar May 29 '20 09:05 CoinCheung

@CoinCheung Oh, I'll check again. I looked at the images and labels before, and I felt that some of the images of cars were ignored. Maybe there are many kinds of cars. Some kinds of cars are ignored. Thank you very much for your help. See V2 come out, two words - worship God!!

yeyuxmf avatar May 29 '20 09:05 yeyuxmf

the code pad image through: im = np.pad(im, ((pad_h, pad_h), (pad_w, pad_w), (0, 0))) lb = np.pad(lb, ((pad_h, pad_h), (pad_w, pad_w)), 'constant', constant_values=255)

my doubt is, why we not set the padded pixes to 0, corresponding to the backgroung ?? like: lb = np.pad(lb, ((pad_h, pad_h), (pad_w, pad_w)), 'constant', constant_values=0)

ZuyongWu avatar Jun 17 '22 00:06 ZuyongWu