in pytouch/common/visualizer.py [0:0]
def points_to_cloud(self, points_3d, colors=None):
clouds = [o3d.geometry.PointCloud()]
for idx, cloud in enumerate(clouds):
points_3d_np = (
points_3d[idx].to("cpu").detach().numpy()
if torch.is_tensor(points_3d[idx])
else points_3d[idx]
)
cloud.points = copy.deepcopy(
o3d.utility.Vector3dVector(points_3d_np.transpose())
)
if colors is not None:
cloud.paint_uniform_color(colors[idx])
return clouds