Load the point cloud from a .npz file.
(cls, f: Union[str, BinaryIO])
| 93 | |
| 94 | @classmethod |
| 95 | def load(cls, f: Union[str, BinaryIO]) -> "PointCloud": |
| 96 | """ |
| 97 | Load the point cloud from a .npz file. |
| 98 | """ |
| 99 | if isinstance(f, str): |
| 100 | with bf.BlobFile(f, "rb") as reader: |
| 101 | return cls.load(reader) |
| 102 | else: |
| 103 | obj = np.load(f) |
| 104 | keys = list(obj.keys()) |
| 105 | return PointCloud( |
| 106 | coords=obj["coords"], |
| 107 | channels={k: obj[k] for k in keys if k != "coords"}, |
| 108 | ) |
| 109 | |
| 110 | def save(self, f: Union[str, BinaryIO]): |
| 111 | """ |