NVIDIA / semantic-segmentation

Nvidia Semantic Segmentation monorepo
BSD 3-Clause "New" or "Revised" License
1.77k stars 387 forks source link

FP FN calculation may be wrong #117

Open Markin-Wang opened 3 years ago

Markin-Wang commented 3 years ago

Thanks for sharing your work. I found that the calculation of FP and FN may error, and apologize if I misunderstand the code. This is the code calculating the FP and FN in misc.py: `

iu_FP = hist.sum(axis=1) - np.diag(hist)

iu_FN = hist.sum(axis=0) - np.diag(hist)

However, I think the axis should be 0 for FP and 1 for FN since the column idx is the predicted label. Besides, the codes demonstrating the TP, FN, FP are:

    class_data.append(100 * iu_TP[class_id] / total_pixels) # TP

    class_data.append(iu_FP[class_id] / iu_TP[class_id])  # FP

    class_data.append(iu_FN[class_id] / iu_TP[class_id]) # FN

` I am confused about why dividing TP when calculating the FP and FN. I am grateful if you can explain more about this.

karansapra commented 3 years ago

Hmm. I see, let me have a look and get back to you later this week.

Markin-Wang commented 3 years ago

Hmm. I see, let me have a look and get back to you later this week.

Hi, what about the feedbacks?

Markin-Wang commented 3 years ago

Hmm. I see, let me have a look and get back to you later this week.

Hi, do you check the code?

karansapra commented 3 years ago

Sorry , i have been swamped with a code freezef, will get to it this weekend for sure.

Markin-Wang commented 3 years ago

Sorry , i have been swamped with a code freezef, will get to it this weekend for sure.

Okay, thanks for your reply and looking forward to the feedback.

karansapra commented 3 years ago

Hmm, you are right about the class_append code that seems incorrect, we will look for the cause and work on a patch, you can disable/ ignore those section for now. Thank you for that.

Markin-Wang commented 3 years ago

Hmm, you are right about the class_append code that seems incorrect, we will look for the cause and work on a patch, you can disable/ ignore those section for now. Thank you for that.

Thanks for your reply.