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

请教解码函数 #33

Open
lucasjinreal opened this issue Jun 29, 2021 · 1 comment
Open

请教解码函数 #33

lucasjinreal opened this issue Jun 29, 2021 · 1 comment

Comments

@lucasjinreal
Copy link

image

yolov5解码函数这里,为什么说mmdetection的anchor已经偏移了0.5? 咋看出来的?

我用detecton2发现的时候,

# 由于mmdetection的anchor已经偏移了0.5,故*2的操作要放在外面
        x_center_pred = (pred_bboxes[..., 0] - 0.5) * 2 * stride + x_center
        y_center_pred = (pred_bboxes[..., 1] - 0.5) * 2 * stride + y_center
        # yolov5中正常情况应该是
        # x_center_pred = (pred_bboxes[..., 0] * 2. - 0.5 + grid[:, 0]) * stride  # xy
        # y_center_pred = (pred_bboxes[..., 1] * 2. - 0.5 + grid[:, 1]) * stride  # xy

用了下面的写法感觉中心点有偏移,是为啥

@lucasjinreal
Copy link
Author

这个x_center和grid_x有啥区别? x_center = grid_x + 0.5吗?

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

1 participant