QingyongHu / SensatUrban

🔥Urban-scale point cloud dataset (CVPR 2021 & IJCV 2022)
MIT License
493 stars 57 forks source link

How to visualize the data (ply files #45

Open RikidWai opened 1 year ago

RikidWai commented 1 year ago

I found a function as follows but it seems not working... Any help is appreciated.

    @staticmethod
    def draw_pc(pc_xyzrgb):
        pc = o3d.geometry.PointCloud()
        pc.points = o3d.utility.Vector3dVector(pc_xyzrgb[:, 0:3])
        if pc_xyzrgb.shape[1] == 3:
            o3d.visualization.draw_geometries([pc])
            return 0
        if np.max(pc_xyzrgb[:, 3:6]) > 20:  ## 0-255
            pc.colors = o3d.utility.Vector3dVector(pc_xyzrgb[:, 3:6] / 255.)
        else:
            pc.colors = o3d.utility.Vector3dVector(pc_xyzrgb[:, 3:6])

        o3d.geometry.PointCloud.estimate_normals(pc)
        o3d.visualization.draw_geometries([pc], width=1000, height=1000)
        return 0
fangtang12 commented 1 year ago

Can you submit new results on the evaluation's website now?