Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the gt-bbox label #5

Open
CapricornZhang opened this issue Apr 28, 2019 · 1 comment
Open

Question about the gt-bbox label #5

CapricornZhang opened this issue Apr 28, 2019 · 1 comment

Comments

@CapricornZhang
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants