inference
This commit is contained in:
13
app.py
13
app.py
@@ -140,6 +140,10 @@ def get_frame_data():
|
||||
camera_params_path = os.path.join(scene_path, 'camera_params')
|
||||
depth_path = os.path.join(scene_path, 'depth')
|
||||
mask_path = os.path.join(scene_path, 'mask')
|
||||
voxel_threshold = 0.005
|
||||
# model_points_normals = DataLoadUtil.load_points_normals(ROOT, scene_name)
|
||||
# model_pts = model_points_normals[:,:3]
|
||||
# down_sampled_model_pts = PtsUtil.voxel_downsample_point_cloud(model_pts, )
|
||||
model_points_normals = DataLoadUtil.load_points_normals(root, scene_name)
|
||||
model_points = model_points_normals[:, :3]
|
||||
|
||||
@@ -172,17 +176,18 @@ def get_frame_data():
|
||||
|
||||
|
||||
point_cloud = DataLoadUtil.get_target_point_cloud_world_from_path(path, binocular=True)
|
||||
sampled_point_cloud = ReconstructionUtil.filter_points(point_cloud, model_points_normals, cam_params['cam_to_world'], theta=75)
|
||||
sampled_point_cloud = PtsUtil.voxel_downsample_point_cloud(sampled_point_cloud, 0.01)
|
||||
sampled_point_cloud = ReconstructionUtil.filter_points(point_cloud, model_points_normals, cam_params['cam_to_world'], voxel_size=voxel_threshold, theta=75)
|
||||
#sampled_point_cloud = point_cloud
|
||||
sampled_point_cloud = PtsUtil.voxel_downsample_point_cloud(sampled_point_cloud, voxel_threshold)
|
||||
|
||||
frame_data['new_point_cloud'] = sampled_point_cloud.tolist()
|
||||
frame_data['combined_point_cloud'] = combined_point_cloud.tolist()
|
||||
new_added_pts = ReconstructionUtil.get_new_added_points(combined_point_cloud, sampled_point_cloud)
|
||||
new_added_pts = ReconstructionUtil.get_new_added_points(combined_point_cloud, sampled_point_cloud, threshold=voxel_threshold)
|
||||
frame_data["new_added_pts"] = new_added_pts.tolist()
|
||||
|
||||
combined_point_cloud = np.concatenate([combined_point_cloud, sampled_point_cloud], axis=0)
|
||||
|
||||
combined_point_cloud = PtsUtil.voxel_downsample_point_cloud(combined_point_cloud, 0.01)
|
||||
combined_point_cloud = PtsUtil.voxel_downsample_point_cloud(combined_point_cloud, voxel_threshold)
|
||||
|
||||
frame_data["coverage_rate"] = frame_info.get('coverage_rate')
|
||||
delta_CR = frame_data["coverage_rate"] - last_CR
|
||||
|
Reference in New Issue
Block a user