kaixin96 / PANet

Code for our ICCV 2019 paper PANet: Few-Shot Image Semantic Segmentation with Prototype Alignment
322 stars 64 forks source link

Question about meanIoU binary #30

Open roywithfiringblade opened 4 years ago

roywithfiringblade commented 4 years ago

Thanks for sharing your work! I am a little confused about the metrics. It is said in the code that the mean IoU binary regards all class as one foreground class. But why the results between mean IoU and mean IoU binary are different in 1-way setting? I mean there is only one class which is foreground class,right?

roywithfiringblade commented 4 years ago

just check the code, i think the mIoU binary is the binary-IoU in the article. But i think in n ways situation.the code might be wrong:

if target_idx_j: # if ground-truth contains this class tp_arr[label] = len(set.intersection(pred_idx_j, target_idx_j)) fp_arr[label] = len(pred_idx_j - target_idx_j) fn_arr[label] = len(target_idx_j - pred_idx_j) in the IoU compute process, the tp,fp,fn are involved only when the GT contains the label. But if there is a class that is contained in pred_label but not in ground truth label, it should be false poistive. And the real meanIoU should be lower due to the larger value of false poistive. Not sure whether i understand the metric correctly, looking forward to your reply!

kaixin96 commented 4 years ago

Hi @704051419 , sorry for the late reply. You are right about the n ways situation. if target_idx_j will cause underestimation of FP when target image does not contain all classes in n-ways. Thank you for pointing it this bug. I will refactor the code.

EvgeniaChroni commented 1 year ago

Is this bug fixed ?