-
Notifications
You must be signed in to change notification settings - Fork 153
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
class number issues #43
Comments
Hi @ifangcheng, |
@hellochick thanks! got it! |
Is it really the same for ade20k and the like datasets where 0 is the void label? It seems to me that if labels are eg [0: void, 1:road, 2:grass, 3:forest, 4:sky], I need to set NUM_CLASSES=5 and just ignore when it predicts 0. at least this is the only way I get same evaluation mIoU when switching void from 255 to 0. |
@Tamme, when I evaluate for ade20k, I subtract the labels by 1, and ignore label -1. You can try this. Since the classes we predict is from 0-149 and the label is from 0-150 where 0 means background. |
@hellochick thats what I thought was sensible, but this at ~ line 140 in evaluate.py seems contradicting: if args.dataset == 'ade20k': Or is it the wrong place I'm looking at :) |
@Tamme Oh, it will lead to the same result. In this code, I add our predictions by 1, so as to shift our prediction from [0-149] to [1-150]. And then ignore the class 0 in ground truth which means background. Is this make sense to you? |
in train.py, for CITYSCAPES_DATASET, the NUM_CLASSES is set 19 (in line 29).
from line 57 we can see
parser.add_argument("--num-classes", type=int, default=NUM_CLASSES,
help="Number of classes to predict (including background).")
So it seems that the --num-classes should "including background".
However, from tools.py we can see that the label_colours (in line 6) includes 19 classes, without background class. it means if we including background class, the NUM_CLASSES should be 20.
So, any explanations about that? or I miss something?
The text was updated successfully, but these errors were encountered: