Skip to content

Commit

Permalink
fix bugs when ply doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianbo Ye committed May 1, 2024
1 parent 18800e8 commit 2482728
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions nerfstudio/process_data/metashape_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def metashape_to_json(
summary = []

if ply_filename is not None:
assert ply_filename.exists()
pc = o3d.io.read_point_cloud(str(ply_filename))
points3D = np.asarray(pc.points)
points3D = np.einsum("ij,bj->bi", applied_transform[:3, :3], points3D) + applied_transform[:3, 3]
Expand Down
4 changes: 2 additions & 2 deletions nerfstudio/scripts/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ def main(self) -> None:

if self.xml.suffix != ".xml":
raise ValueError(f"XML file {self.xml} must have a .xml extension")
if not self.xml.exists:
if not self.xml.exists():
raise ValueError(f"XML file {self.xml} doesn't exist")
if self.eval_data is not None:
raise ValueError("Cannot use eval_data since cameras were already aligned with Metashape.")

if self.ply is not None:
if self.ply.suffix != ".ply":
raise ValueError(f"PLY file {self.ply} must have a .ply extension")
if not self.ply.exists:
if not self.ply.exists():
raise ValueError(f"PLY file {self.ply} doesn't exist")

self.output_dir.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 2482728

Please sign in to comment.