zhimingluo / UnitBox_TF

25 stars 11 forks source link

Question about the gt-bbox label #5

Open CapricornZhang opened 5 years ago

CapricornZhang commented 5 years ago

the code is as follows:

        for bbox in bboxes:
            bbox = np.array(bbox) * ratio

            x1, y1, w, h = int(bbox[0]), int(bbox[1]), int(bbox[2]), int(bbox[3])

            x1 = np.maximum(x1, 0)
            y1 = np.maximum(y1, 0)
            x2 = np.minimum(x1+w, nw)
            y2 = np.minimum(y1+h, nh)

            l_score[y1:y2, x1:x2] = 1.

            for yy in range(y1, y2):
                l_bbox[yy, x1:x2, 0] = yy - y1
                l_bbox[yy, x1:x2, 1] = y2 - yy

            for xx in range(x1, x2):
                l_bbox[y1:y2, xx, 2] = xx - x1
                l_bbox[y1:y2, xx, 3] = x2 - xx

        im = np.expand_dims(im, axis=0)
        l_score = np.expand_dims(l_score, axis=0)
        l_score = np.expand_dims(l_score, axis=3)
        l_bbox = np.expand_dims(l_bbox, axis=0)

        l_bbox /= 64.

After getting the offsets between the (xx,yy) position and every side of the ground truth,why should you divide the value of l_bbox by 64? Must the value of the divisor be 64?

zhimingluo commented 5 years ago

除以64主要是让回归的坐标的范围变小一些,也可以除以其他值或者不除