MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / fetchPly

Function fetchPly

scene/dataset_readers.py:118–131  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

116 return cam_infos
117
118def fetchPly(path):
119 plydata = PlyData.read(path)
120 vertices = plydata['vertex']
121 positions = np.vstack([vertices['x'], vertices['y'], vertices['z']]).T
122 colors = np.vstack([vertices['red'], vertices['green'], vertices['blue']]).T / 255.0
123 if 'nx' in vertices:
124 normals = np.vstack([vertices['nx'], vertices['ny'], vertices['nz']]).T
125 else:
126 normals = np.zeros_like(positions)
127 if 'time' in vertices:
128 timestamp = vertices['time'][:, None]
129 else:
130 timestamp = None
131 return BasicPointCloud(points=positions, colors=colors, normals=normals, time=timestamp)
132
133def storePly(path, xyz, rgb):
134 # Define the dtype for the structured array

Callers 2

readColmapSceneInfoFunction · 0.85
readNerfSyntheticInfoFunction · 0.85

Calls 1

BasicPointCloudClass · 0.85

Tested by

no test coverage detected