DrSleep / tensorflow-deeplab-resnet

DeepLab-ResNet rebuilt in TensorFlow
MIT License
1.25k stars 429 forks source link

anyway to get the class specific prediction? #14

Closed gaopeng-eugene closed 7 years ago

gaopeng-eugene commented 7 years ago

In the evaluation code, how can we get class specific accuracy rather the average?

DrSleep commented 7 years ago

Yes, it is possible. All you need is to acquire the confusion matrix (which is a TF local variable) and repeat the same computations as here without the reduce_mean op. This has also been asked on StackOverflow: http://stackoverflow.com/questions/40340728/tensorflow-how-can-i-get-the-total-cm-in-tf-contrib-metrics-streaming-mean-iou

I don't have the relevant code at the moment, so if you have hard time getting predictions per class, let me know and I will look at it later.