When I save the result, I get the prediction and do the minus operation (prediction-1). However, I got the following error.
I got two questions.
1): How can I handle the '0' prediction (the 'others' class)? When I do the minus operation, it becomes '-1';
2) I took a look at the difference between the submission example and my result, and I find that the example is colormap type and mine is grayscale type. Is this will cause a drop in performance?
Would you please provide the code about how to save the result, thank you.
Traceback (most recent call last):
File "/tmp/codalab/tmpctKU3a/run/program/score.py", line 139, in
eval_.add_batch(tar_,pred_)
File "/tmp/codalab/tmpctKU3a/run/program/score.py", line 59, in add_batch
self.confusion_matrix += self._generate_matrix(gt_image, pre_image)
File "/tmp/codalab/tmpctKU3a/run/program/score.py", line 53, in _generate_matrix
confusion_matrix = count.reshape(self.num_class, self.num_class)
ValueError: cannot reshape array of size 15384 into shape (124,124)
1) As shown in Evaluation, "The number range of your submission must be 0-123. The category-number dictionary "label_num_dic_final.json" in VSPW dataset shows that 0 denotes "others" , 1 denotes "wall", 2 denotes "ceiling" ... However, "others" is not evaluated. Thus, the corresponding number of category for submission should be origin number minus 1, i.e., 0 denotes "wall", 1 denotes "ceiling"..."
Since the 'other' class is not evaluated, I suggest that you do NOT predict the 'other' class. You can directly predict 124 classes, and 0 denotes "wall", 1 denotes "ceiling"...
You can refer to a baseline code https://github.com/VSPW-dataset/VSPW_baseline.
2) The color is only used for visulization and does not affect the performance.
So when I train the model, I should predict the '0-123' ( total 124) classes?
Posted by: abcdvzzha @ July 3, 2021, 5:25 a.m.Yes, it is better to predict the '0-123' ( total 124) classes.
Posted by: miaomm @ July 3, 2021, 7:53 a.m.So in the training set or val set, I have to remap the '0, 1-124' to '255, 0-123' (255 is ignored). Is this correct?
Or are you suggesting there is no '0' in the groundtruth of training set and val set?
Yes. That's right.
The code is
"
label[label==0]=255
label=label-1
label[label==254]=255
"
But I didn't see any remap operation in the code you provided. Is there anything I missed?
Posted by: abcdvzzha @ July 3, 2021, 9:19 a.m.In dataset.py, the function " segm_transform".
def segm_transform(self, segm):
# to tensor, -1 to 149
segm[segm==0]=255
segm = segm-1
segm[segm==254]=255
segm = torch.from_numpy(segm).float()
segm = segm.unsqueeze(0)
return segm
ok,I got it. Sorry for bothering you. Thank you very much.
Posted by: abcdvzzha @ July 3, 2021, 9:37 a.m.No worries. Wish you enjoy the competition.
Posted by: miaomm @ July 3, 2021, 9:40 a.m.