MCPcopy Create free account
hub / github.com/openai/shap-e / load

Method load

shap_e/rendering/point_cloud.py:95–108  ·  view source on GitHub ↗

Load the point cloud from a .npz file.

(cls, f: Union[str, BinaryIO])

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

PointCloudClass · 0.85

Tested by

no test coverage detected