MCPcopy Create free account
hub / github.com/apple/ml-pointersect / save_as_npbgpp

Method save_as_npbgpp

pointersect/inference/structures.py:680–697  ·  view source on GitHub ↗

Save the ib-th point cloud as a ply file.

(
            self,
            filenames: T.List[str],
            overwrite: bool = False,
    )

Source from the content-addressed store, hash-verified

678 torch.save(state_dict, filename)
679
680 def save_as_npbgpp(
681 self,
682 filenames: T.List[str],
683 overwrite: bool = False,
684 ):
685 """Save the ib-th point cloud as a ply file."""
686 assert len(filenames) == self.xyz_w.size(0)
687 for filename in filenames:
688 if os.path.exists(filename) and not overwrite:
689 raise RuntimeError
690
691 # o3d point cloud
692 o3d_pcds = self.get_o3d_pcds()
693 for i in range(self.xyz_w.size(0)):
694 o3d.io.write_point_cloud(
695 filename=filenames[i],
696 pointcloud=o3d_pcds[i],
697 )
698
699 def realize_valid_mask(self):
700 if self.valid_mask is not None:

Callers 1

save_as_npbgpp_inputMethod · 0.80

Calls 2

get_o3d_pcdsMethod · 0.95
sizeMethod · 0.80

Tested by

no test coverage detected