change config and remove online evaluation

This commit is contained in:
2024-09-20 11:49:32 +00:00
parent 8517255245
commit 6cdff9c83f
4 changed files with 34 additions and 34 deletions

View File

@@ -161,28 +161,28 @@ class NBVReconstructionDataset(BaseDataset):
}
if self.type == namespace.Mode.TEST:
diag = DataLoadUtil.get_bbox_diag(self.model_dir, scene_name)
voxel_threshold = diag*0.02
model_points_normals = DataLoadUtil.load_points_normals(self.root_dir, scene_name)
pts_list = []
for view in scanned_views:
frame_idx = view[0]
view_path = DataLoadUtil.get_path(self.root_dir, scene_name, frame_idx)
point_cloud = DataLoadUtil.get_target_point_cloud_world_from_path(view_path, binocular=True)
cam_params = DataLoadUtil.load_cam_info(view_path, binocular=True)
sampled_point_cloud = ReconstructionUtil.filter_points(point_cloud, model_points_normals, cam_pose=cam_params["cam_to_world"], voxel_size=voxel_threshold, theta=self.filter_degree)
pts_list.append(sampled_point_cloud)
nL_to_world_pose = cam_params["cam_to_world"]
nO_to_world_pose = cam_params["cam_to_world_O"]
nO_to_nL_pose = np.dot(np.linalg.inv(nL_to_world_pose), nO_to_world_pose)
data_item["scanned_target_pts_list"] = pts_list
data_item["model_points_normals"] = model_points_normals
data_item["voxel_threshold"] = voxel_threshold
data_item["filter_degree"] = self.filter_degree
data_item["scene_path"] = os.path.join(self.root_dir, scene_name)
data_item["first_frame_to_world"] = np.asarray(first_frame_to_world, dtype=np.float32)
data_item["nO_to_nL_pose"] = np.asarray(nO_to_nL_pose, dtype=np.float32)
# if self.type == namespace.Mode.TEST:
# diag = DataLoadUtil.get_bbox_diag(self.model_dir, scene_name)
# voxel_threshold = diag*0.02
# model_points_normals = DataLoadUtil.load_points_normals(self.root_dir, scene_name)
# pts_list = []
# for view in scanned_views:
# frame_idx = view[0]
# view_path = DataLoadUtil.get_path(self.root_dir, scene_name, frame_idx)
# point_cloud = DataLoadUtil.get_target_point_cloud_world_from_path(view_path, binocular=True)
# cam_params = DataLoadUtil.load_cam_info(view_path, binocular=True)
# sampled_point_cloud = ReconstructionUtil.filter_points(point_cloud, model_points_normals, cam_pose=cam_params["cam_to_world"], voxel_size=voxel_threshold, theta=self.filter_degree)
# pts_list.append(sampled_point_cloud)
# nL_to_world_pose = cam_params["cam_to_world"]
# nO_to_world_pose = cam_params["cam_to_world_O"]
# nO_to_nL_pose = np.dot(np.linalg.inv(nL_to_world_pose), nO_to_world_pose)
# data_item["scanned_target_pts_list"] = pts_list
# data_item["model_points_normals"] = model_points_normals
# data_item["voxel_threshold"] = voxel_threshold
# data_item["filter_degree"] = self.filter_degree
# data_item["scene_path"] = os.path.join(self.root_dir, scene_name)
# data_item["first_frame_to_world"] = np.asarray(first_frame_to_world, dtype=np.float32)
# data_item["nO_to_nL_pose"] = np.asarray(nO_to_nL_pose, dtype=np.float32)
return data_item
def __len__(self):