I'm confused by some code of losses.py in the 78th line.
IoU = calc_iou(anchors[0, :, :], bbox_annotation[:, :4]) # num_anchors x num_annotations
If I understand corrently, the first dimension of anchors represents different examples in the batch, and bbox_annotation is the jth example in the batch. Then does it make more sense to be
IoU = calc_iou(anchors[j, :, :], bbox_annotation[:, :4]) # num_anchors x num_annotations?
For the code of clac_iou, which is the part we need to complete, we're required to calculate the IoU between two boxes, here we are calculating IoU between num_anchors and num_annotations, so does a,b in the function calc_IoU are batches of boxes?
Great question. Note that imgs in one batch use same anchors. You can debug the shape of anchors. It should be [1, xx, xx], instead of [batch size, xx, xx]. Find more details about how to generate anchors in anchors.py,
I'm confused by some code of losses.py in the 78th line.
IoU = calc_iou(anchors[0, :, :], bbox_annotation[:, :4]) # num_anchors x num_annotations
If I understand corrently, the first dimension of anchors represents different examples in the batch, and bbox_annotation is the jth example in the batch. Then does it make more sense to be
IoU = calc_iou(anchors[j, :, :], bbox_annotation[:, :4]) # num_anchors x num_annotations
?For the code of clac_iou, which is the part we need to complete, we're required to calculate the IoU between two boxes, here we are calculating IoU between num_anchors and num_annotations, so does a,b in the function calc_IoU are batches of boxes?