Skip to content

Commit

Permalink
feat: add script to eval cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
YifuTao committed Aug 30, 2024
1 parent 0fdf769 commit cf81c0f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/eval_cloud.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pathlib import Path

import numpy as np
import open3d as o3d

from oxford_spires_utils.eval import save_error_cloud


def evaluate_cloud(input_cloud_path, gt_cloud_path):
gt_cloud = o3d.io.read_point_cloud(str(gt_cloud_path))
input_cloud = o3d.io.read_point_cloud(str(input_cloud_path))
save_error_cloud_path = str(Path(input_cloud_path).with_name(f"{Path(input_cloud_path).stem}_error.ply"))
input_cloud_np = np.array(input_cloud.points)
gt_cloud_np = np.array(gt_cloud.points)
save_error_cloud(input_cloud_np, gt_cloud_np, save_error_cloud_path)


if __name__ == "__main__":
gt_cloud_path = "/home/yifu/workspace/T-RO_2025/2024-03-18-chch-4/rtc_gt_colmap_frame.ply"
input_cloud_path = "/home/yifu/workspace/T-RO_2025/2024-03-18-chch-4/nerf_rgb_merged.ply"

evaluate_cloud(input_cloud_path, gt_cloud_path)

0 comments on commit cf81c0f

Please sign in to comment.