ethnhe / PVN3D

Code for "PVN3D: A Deep Point-wise 3D Keypoints Hough Voting Network for 6DoF Pose Estimation", CVPR 2020
MIT License
488 stars 105 forks source link

A problem about add_real_back #40

Closed pyni closed 3 years ago

pyni commented 4 years ago

Hi~ I find a problem (maybe an error) about your code: in add_real_back function: dpt = dpt (dpt_msk > 0).astype(dpt.dtype) + \ dpt_back (dpt_msk <=0).astype(dpt.dtype)

Here dpt is the rendered image, the cam_scale of which is 1.0, while dpt_back is a real image, the cam_scale of which is 1000.0. I wonder whether they can be added up directly?

ethnhe commented 3 years ago

In this setting, the real background is far from the foreground target objects, and the sample input points won't be concentrated on the foreground objects. Maybe it's better to scale them to the same unit and ensure that the foreground object is before the background table with a z-buffer like operation.

pyni commented 3 years ago

您好,我个人认为是不是这样的设置是有问题的,因为得到的深度图中前景物体和背景的尺寸相差了1000倍(换句话说,如果背景是真实场景的背景,这样渲染的前景物体缩小到几乎是一个点。。。换句话说,其实也可以认为前景物体的深度信息被挖掉了) 请问您linemod数据集结果也是用的这样的设置么?我不确定这样对训练linemod是否有帮助

ethnhe commented 3 years ago

我回头看了一下paper用的开源前的代码我是将他们转换到同一个单位的,raster_triangle我存的mm为单位的深度图,不过目前这份代码开源前我是训过一个物品的模型验证过的,训出来的模型表现差别不大。所以这个背景尺寸的影响其实不是很大。和随机贴RGB背景一样,贴depth背景的主要作用也是使得数据预处理能随机采样到一些背景点给模型的segmentation分支当负样本训练。render图的depth的负样本尺度和真实的负样本不一样估计也不影响,因为这部分真实场景图的背景负样本在真图训练集里模型已经见过了。