Below is an example of IoU being applied to bounding boxes from one image (one image per batch).
iou = torchvision.ops.box_iou(predictions['boxes'], targets['boxes']) print(iou) tensor([[0.0000, 0.0000], [0.0000, 0.0000], [0.0000, 0.0000], [0.0000, 0.0000], [0.0000, 0.9322], [0.8021, 0.0000], [0.0000, 0.0000], [0.0000, 0.0000]])
I understand that the tensors above show pairwise outputs related to the IoU overlap per predicted bounding box. So, in this case there are two bounding boxes with an overlap determined for the first bounding box in the 6th tensor and for the second bounding box, in the 5th tensor.
However, I would like to know how I can use this information to determine true positives, false positives and false negatives. It’s unclear to me ATM how I can relate these boxes to the previous info such as predictions, targets and image id name…
I would eventually like to save the coordinates of these true positive and false positives bounding boxes and extract them from the image later.