MCPcopy
hub / github.com/zju3dv/4K4D / farthest_down_sample

Function farthest_down_sample

easyvolcap/utils/fcds_utils.py:309–314  ·  view source on GitHub ↗
(pcd: torch.Tensor, pcd_t: torch.Tensor = None, K: int = 65536)

Source from the content-addressed store, hash-verified

307
308
309def farthest_down_sample(pcd: torch.Tensor, pcd_t: torch.Tensor = None, K: int = 65536):
310 import open3d as o3d
311 o3d_pcd = o3d.geometry.PointCloud()
312 o3d_pcd.points = o3d.utility.Vector3dVector(pcd.view(-1, 3).detach().cpu().numpy())
313 o3d_pcd = o3d_pcd.farthest_point_down_sample(K)
314 return torch.as_tensor(np.array(o3d_pcd.points)).to(pcd.device, pcd.dtype, non_blocking=True).view(pcd.shape[0], -1, 3)
315
316
317def sample_random_points(pcd: torch.Tensor, pcd_t: torch.Tensor = None, K: int = 500):

Callers

nothing calls this directly

Calls 2

numpyMethod · 0.80
cpuMethod · 0.80

Tested by

no test coverage detected