How to handle the mean Intersection Over Union (mI

2019-07-10 04:11发布

I implemented a FCN network to do semantic segmentation. I am using Cityscapes as my dataset. As you know, there are some classes in Cityscapes that you ignore during the training and it is labeled as 255. I used weighted loss to ignore the loss for the unknown classes(set the loss to zero for unknown class). Now I want to exclude unknown class from my evaluation metric(mean Intersection Over Union (mIOU)).It is not clear for me how to exclude the unknown class at this point.

At the moment I am considering all the classes including the unknown class like this using tensorflow method:

 miou, confusion_mat = tf.metrics.mean_iou(labels=annotation, predictions=pred_annotation, num_classes=num_cls)

with tf.control_dependencies([tf.identity(confusion_mat)]):
    miou = tf.identity(miou)

I tried this , but it give an error for unbound label(for the unkonwn label)

miou, confusion_mat = tf.metrics.mean_iou(labels=annotation, predictions=pred_annotation, num_classes=(num_cls-1))

0条回答
登录 后发表回答