|
def bbox_to_activ(bboxes, anchors, flatten=True): |
|
"Return the target of the model on `anchors` for the `bboxes`." |
|
if flatten: |
|
t_centers = (bboxes[...,:2] - anchors[...,:2]) / anchors[...,2:] |
|
t_sizes = torch.log(bboxes[...,2:] / anchors[...,2:] + 1e-8) |
|
return torch.cat([t_centers, t_sizes], -1).div_(bboxes.new_tensor([[0.1, 0.1, 0.2, 0.2]])) |
|
else: return [activ_to_bbox(act,anc) for act,anc in zip(acts, anchors)] |
|
return res |
Shouldn't line 23 be
else: return [bbox_to_activ(bbox, anc) for bbox, anc in zip(bboxes, anchors)]
walkwithfastai.github.io/wwf/vision/object_detection/metrics.py
Lines 17 to 24 in ecdd5ed
Shouldn't line 23 be