Open
Description
When running calculate_iou
with two depth maps, the computed IoU occasionally exceeds 1, which is mathematically incorrect. I suspect the issue originates from datasets_preprocess/scannetpp_preprocess.py#L200:
union = torch.sum(valid_mask) + torch.sum(depth2 > 0) - intersection
Here, torch.sum(depth2 > 0)
counts all non-zero depth points in depth2
, rather than only those corresponding to the projected depth1
pixels. As a result, this can underestimate union
, leading to an IoU value greater than 1.
To correct this, I believe the calculation should be adjusted as follows:
valid_depth2_mask = depth2[pixels_img2[:, 1], pixels_img2[:, 0]] > 0
union = torch.sum(valid_mask) + torch.sum(valid_depth2_mask) - intersection
Metadata
Metadata
Assignees
Labels
No labels