mmdetection-mini icon indicating copy to clipboard operation
mmdetection-mini copied to clipboard

请教解码函数

Open lucasjinreal opened this issue 4 years ago • 1 comments

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 avatar Jun 29 '21 03:06 lucasjinreal

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

lucasjinreal avatar Jun 29 '21 03:06 lucasjinreal