Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the loss function ignore the tag of 255. #59

Open
huang229 opened this issue May 29, 2020 · 5 comments
Open

Why does the loss function ignore the tag of 255. #59

huang229 opened this issue May 29, 2020 · 5 comments

Comments

@huang229
Copy link

huang229 commented May 29, 2020

@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?

@CoinCheung
Copy link
Owner

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

@huang229
Copy link
Author

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

@CoinCheung
Copy link
Owner

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

@huang229
Copy link
Author

@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!!

@ZuyongWu
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants