MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / fetchPly

Function fetchPly

examples/datasets/INVR.py:19–32  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

17)
18
19def fetchPly(path):
20 plydata = PlyData.read(path)
21 vertices = plydata['vertex']
22 positions = np.vstack([vertices['x'], vertices['y'], vertices['z']]).T
23 colors = np.vstack([vertices['red'], vertices['green'], vertices['blue']]).T / 255.0
24 if 'nx' in vertices:
25 normals = np.vstack([vertices['nx'], vertices['ny'], vertices['nz']]).T
26 else:
27 normals = np.zeros_like(positions)
28 if 'time' in vertices:
29 timestamp = vertices['time'][:, None]
30 else:
31 timestamp = None
32 return BasicPointCloud(points=positions, colors=colors, normals=normals, time=timestamp)
33
34class BasicPointCloud(NamedTuple):
35 points : np.array

Callers 1

__init__Method · 0.70

Calls 1

BasicPointCloudClass · 0.70

Tested by

no test coverage detected