SnowflakeNet icon indicating copy to clipboard operation
SnowflakeNet copied to clipboard

Testing on my point cloud

Open FSet89 opened this issue 1 year ago • 1 comments

I want to test the completion model on my point cloud. I load it as a Nx3 array where N~9000 and I feed it to the ckpt-best-shapenet34_21-cd_l2.pth model checkpoint. The output is a list of 4 tensors with shape: torch.Size([1, 256, 3]) torch.Size([1, 512, 3]) torch.Size([1, 2048, 3]) torch.Size([1, 8192, 3]) I'm a bit confused here. How do I recover the predicted cloud? I tried to switch C and N axes like suggested in another issue but I get a CUDA error:

CUDA kernel failed : invalid configuration argument void gather_points_kernel_wrapper(int, int, int, int, const float*, const int*, float*) at L:29 in /home/x/SnowflakeNet/models/pointnet2_ops_lib/pointnet2_ops/_ext-src/src/sampling_gpu.cu

FSet89 avatar Mar 14 '24 15:03 FSet89

Please refer to this issue https://github.com/AllenXiangX/SnowflakeNet/issues/23 After the prediction is generated, you can try:

completed_pc = open3d.geometry.PointCloud()
# result is a list of tensors
completed_point_cloud = completed_point_cloud[-1].cpu().numpy()
# convert to float64 array
completed_point_cloud = completed_point_cloud.astype(np.float64)
# remove first dimension
completed_point_cloud = np.squeeze(completed_point_cloud)
print("Predicted Shape", completed_point_cloud.shape)
completed_pc.points = open3d.utility.Vector3dVector(completed_point_cloud)

where completed_point_cloud is the model output after running Mustafa's function complete_point_cloud in his script. I hope this helps!

BowenTan02 avatar Mar 28 '24 22:03 BowenTan02