From 49bcf203a883bc951e3fc8422b0a280e60a9c423 Mon Sep 17 00:00:00 2001 From: hofee Date: Mon, 28 Oct 2024 16:48:34 +0000 Subject: [PATCH] update --- configs/local/strategy_generate_config.yaml | 10 +++++----- runners/strategy_generator.py | 14 +++++++++----- utils/reconstruction.py | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/configs/local/strategy_generate_config.yaml b/configs/local/strategy_generate_config.yaml index cf444b0..6ca14cc 100644 --- a/configs/local/strategy_generate_config.yaml +++ b/configs/local/strategy_generate_config.yaml @@ -12,18 +12,18 @@ runner: generate: voxel_threshold: 0.003 - overlap_area_threshold: 25 + overlap_area_threshold: 30 compute_with_normal: False scan_points_threshold: 10 overwrite: False - seq_num: 15 + seq_num: 10 dataset_list: - OmniObject3d datasets: OmniObject3d: - root_dir: C:\\Document\\Local Project\\nbv_rec\\nbv_reconstruction\\temp - from: 0 - to: 1 # -1 means end + root_dir: /home/data/hofee/project/nbv_rec_part2_preprocessed + from: 960 + to: 1000 # -1 means end diff --git a/runners/strategy_generator.py b/runners/strategy_generator.py index 60a5cfc..8fe98c1 100644 --- a/runners/strategy_generator.py +++ b/runners/strategy_generator.py @@ -85,14 +85,18 @@ class StrategyGenerator(Runner): pts_path = os.path.join(root,scene_name, "pts", f"{frame_idx}.npy") nrm_path = os.path.join(root,scene_name, "nrm", f"{frame_idx}.npy") idx_path = os.path.join(root,scene_name, "scan_points_indices", f"{frame_idx}.npy") + pts = np.load(pts_path) - if pts.shape[0] == 0: - nrm = np.zeros((0,3)) - else: - nrm = np.load(nrm_path) + if self.compute_with_normal: + if pts.shape[0] == 0: + nrm = np.zeros((0,3)) + else: + nrm = np.load(nrm_path) + nrm_list.append(nrm) + indices = np.load(idx_path) pts_list.append(pts) - nrm_list.append(nrm) + scan_points_indices_list.append(indices) if pts.shape[0] > 0: non_zero_cnt += 1 diff --git a/utils/reconstruction.py b/utils/reconstruction.py index ac359aa..926e9c9 100644 --- a/utils/reconstruction.py +++ b/utils/reconstruction.py @@ -62,7 +62,7 @@ class ReconstructionUtil: max_rec_pts = np.vstack(point_cloud_list) downsampled_max_rec_pts = PtsUtil.voxel_downsample_point_cloud(max_rec_pts, threshold) - + combined_point_cloud = PtsUtil.voxel_downsample_point_cloud(combined_point_cloud, threshold) max_rec_pts_num = downsampled_max_rec_pts.shape[0] max_real_rec_pts_coverage, _ = ReconstructionUtil.compute_coverage_rate(target_point_cloud, downsampled_max_rec_pts, threshold)