The code for depth and depth point cloud
qijiyaolinZGH opened this issue · comments
The depth predictor cannot release for now (owned by Adobe)
But here the code how I generate the depth image and depth point cloud.
the depth you mentioned before is calculated by
depth_normalized = depth / depth.max()
while depth should be something you get from predictor
depth_pred.zip
for the final pc per object, you might need to do something like this for each point cloud
depth_normalized [:,0] = -depth_normalized [:,0]
depth_normalized [:,2] = -depth_normalized [:,2]
and
seg_point_cloud3d = point_cloud[segment_imge>=1]
camera_rot_mat = rotate3D(-cameraPitch, 0, cameraRoll, device='cpu')[:3,:3].numpy()
seg_point_cloud3d = np.dot(seg_point_cloud3d, camera_rot_mat)
Here is also another zip file for you to reference:
debug_depth.obj
is the raw point cloud generate by depth predictor
inital_pc
contains result of both per object point cloud and inital position of object(rotation=0)
debug.zip