zanilzanzan / FuseNet_PyTorch

Joint scene classification and semantic segmentation with FuseNet
GNU General Public License v3.0
108 stars 34 forks source link

weights about dataset #16

Closed NanWangAC closed 5 years ago

NanWangAC commented 5 years ago

Hi, I have some questions about how do you calculate category weights for nyudv2 datasets and sun datasets?

zanilzanzan commented 5 years ago

I didn’t use class mapping for NYUv2 during training. However, if you want to incorporate that to cross-entropy loss; in order to calculate these weights, you can sum all the pixels belonging to each class in the training set and divide them by the total sum of all the pixels for all classes. Ignore zero labels.

zanilzanzan commented 5 years ago

Please let me know when your problem is solved, so I can close this issue.

NanWangAC commented 5 years ago

Ok, I get it! But the weights in weights.txt doesn't seem to calculate that way

hazirbas commented 5 years ago

Hi, please divide the number pixels by the number of images on which the class presents, and then inverse the frequency as in:

https://arxiv.org/abs/1411.4734

NanWangAC commented 5 years ago

I get it! thanks for ur kind! (#^.^#)