TUI-NICR / ESANet

ESANet: Efficient RGB-D Semantic Segmentation for Indoor Scene Analysis
Other
231 stars 49 forks source link

the issue about confusion matrix #38

Closed zhouqunbing closed 2 years ago

zhouqunbing commented 2 years ago

i’m sorry to bother you again.i don't understand some codes in the ''confusion_matrix.py''. ①where are the numbers [0,0,1,2,3,] and [1, 1, 0, 2, 3] come from?The categorys of dataset is more than 4. ②why do you give the prediction before training? ③Is that number just for testing the function of confusion matrix? Thank you!

if name == 'main':

test if pytorch confusion matrix and tensorflow confusion matrix

# compute the same
label = np.array([0, 0, 1, 2, 3])
prediction = np.array([1, 1, 0, 2, 3])

cm_tf = ConfusionMatrixTensorflow(4)
cm_pytorch = ConfusionMatrixPytorch(4)
miou = miou_pytorch(cm_pytorch)
danielS91 commented 2 years ago

This part of the code only gets called if the file is executed directly, not if it is imported by other files or top-level scripts (see here). So it is just a simple "test" not related to the remaining code at all.