bubbliiiing / yolo3-pytorch

这是一个yolo3-pytorch的源码,可以用于训练自己的模型。
MIT License
1.99k stars 584 forks source link

大佬这段代码为什么真实框要用0,0啊 #48

Open Sevenlepus opened 3 years ago

Sevenlepus commented 3 years ago
        # 计算真实框的位置
        gt_box = torch.FloatTensor(torch.cat([torch.zeros_like(gws), torch.zeros_like(ghs), gws, ghs], 1))

        # 计算出所有先验框的位置
        anchor_shapes = torch.FloatTensor(torch.cat((torch.zeros((self.num_anchors, 2)), torch.FloatTensor(anchors)), 1))
        # 计算重合程度
        anch_ious = jaccard(gt_box, anchor_shapes)
bubbliiiing commented 3 years ago

啊?因为要求真实框和先验框的重合程度,然后筛选先验框中最重合的一个框