-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version (dev-1.x) or latest version (dev-1.0).
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
main branch https://github.com/open-mmlab/mmdetection3d
Environment
pytorch 1.13.1 + cu113 + mmdet3d v1.4
Reproduces the problem - code sample
在mmdet3d/models/dense_heads/fcos_mono3d_head.py文件内
class FCOSMono3DHead(AnchorFreeMono3DHead):
def __predict_by_feat_singel(self,....):
view = np.array(img_meta['cam2img'])
scale_factor = img_meta['scale_factor']
......
for cls_score, bbox_pred, dir_cls_pred, attr_pred, centerness,
points in zip(cls_score_list, bbox_pred_list,
dir_cls_pred_list, attr_pred_list,
centerness_pred_list, mlvl_points):
# change the offset to actual center predictions
bbox_pred[:, :2] = points - bbox_pred[:, :2]
if rescale:
bbox_pred[:, :2] /= bbox_pred[:, :2].new_tensor(scale_factor)
pred_center2d = bbox_pred[:, :3].clone()
bbox_pred[:, :3] = points_img2cam(bbox_pred[:, :3], view)
在上述这段代码中,如果你缩放了分辨率,例如scale_factor分辨率为0.5,则viewpad对应的内参也会缩放0.5倍,
当设置rescale=True的时候,预测的center_2d中心点会还原回到原始尺寸,这时候在代码最后一行做img2cam转换时候,内参并未被还原导致cam坐标系下的坐标不正确,从而降低了训练指标
Reproduces the problem - command or script
无
Reproduces the problem - error message
推理指标变低
Additional information
No response