Skip to content

Commit

Permalink
docs for loading 3D points
Browse files Browse the repository at this point in the history
  • Loading branch information
CardiacMangoes committed Jan 18, 2024
1 parent 996186e commit 3eb6a69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 10 additions & 0 deletions nerfstudio/data/dataparsers/nerfstudio_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ def _generate_dataparser_outputs(self, split="train"):
return dataparser_outputs

def _load_3D_points(self, ply_file_path: Path, transform_matrix: torch.Tensor, scale_factor: float):
"""Loads point clouds positions and colors from .ply
Args:
ply_file_path: Path to .ply file
transform_matrix: Matrix to transform world coordinates
scale_factor: How much to scale the camera origins by.
Returns:
A dictionary of points: points3D_xyz and colors: points3D_rgb
"""
import open3d as o3d # Importing open3d is slow, so we only do it if we need it.


Expand Down
6 changes: 2 additions & 4 deletions nerfstudio/process_data/colmap_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,8 @@ def create_ply_from_colmap(recon_dir, output_dir):
"""Writes a ply file from colmap.
Args:
output_dir: The number of initial frames.
Returns:
A summary of the matching results.
recon_dir: Directory to grab colmap points
output_dir: Directory to output .ply
"""
if (recon_dir / "points3D.bin").exists():
colmap_points = read_points3D_binary(recon_dir / "points3D.bin")
Expand Down

0 comments on commit 3eb6a69

Please sign in to comment.