Main rendering function that calls different methods.
(
render_pointersect: bool,
render_npbgpp: bool,
render_surfel: bool,
render_nglod: bool,
render_ngp: bool,
render_dsnerf: bool,
render_ibrnet: bool,
densify_neural_points: bool,
render_poisson: bool,
input_rgbd_images: T.Optional[RGBDImage],
input_point_cloud: T.Optional[PointCloud],
output_cameras: Camera,
model_filename: T.Union[T.List[str], str],
k: int,
th_hit_prob: float,
max_ray_chunk_size: int,
max_pr_chunk_size: int,
max_model_chunk_size: int,
output_camera_setting: T.Dict[str, T.Any],
pr_setting: T.Dict[str, T.Any],
model_loading_settings: T.Dict[str, T.Any],
save_settings: T.Dict[str, T.Any],
data_device: torch.device,
model_device: torch.device,
output_dir: str = None,
gt_rgbd_images: RGBDImage = None,
gt_mesh: Mesh = None,
surfel_point_size: T.Union[float, T.List[float]] = 1.,
num_samples_per_pixel: int = 1,
neural_point_upsample_ratio_x48: int = 1,
total_nglod_epoch: int = 50,
nglod_test_every_iter: int = 50,
total_ngp_epoch: int = 50,
ngp_test_every_iter: int = 50,
total_dsnerf_iter: int = 50000,
dsnerf_test_every_iter: int = 5000,
test_plane_normal: bool = False,
ibrnet_chunk_size: int = 4096,
)
| 700 | |
| 701 | |
| 702 | def main_render( |
| 703 | render_pointersect: bool, |
| 704 | render_npbgpp: bool, |
| 705 | render_surfel: bool, |
| 706 | render_nglod: bool, |
| 707 | render_ngp: bool, |
| 708 | render_dsnerf: bool, |
| 709 | render_ibrnet: bool, |
| 710 | densify_neural_points: bool, |
| 711 | render_poisson: bool, |
| 712 | input_rgbd_images: T.Optional[RGBDImage], |
| 713 | input_point_cloud: T.Optional[PointCloud], |
| 714 | output_cameras: Camera, |
| 715 | model_filename: T.Union[T.List[str], str], |
| 716 | k: int, |
| 717 | th_hit_prob: float, |
| 718 | max_ray_chunk_size: int, |
| 719 | max_pr_chunk_size: int, |
| 720 | max_model_chunk_size: int, |
| 721 | output_camera_setting: T.Dict[str, T.Any], |
| 722 | pr_setting: T.Dict[str, T.Any], |
| 723 | model_loading_settings: T.Dict[str, T.Any], |
| 724 | save_settings: T.Dict[str, T.Any], |
| 725 | data_device: torch.device, |
| 726 | model_device: torch.device, |
| 727 | output_dir: str = None, |
| 728 | gt_rgbd_images: RGBDImage = None, |
| 729 | gt_mesh: Mesh = None, |
| 730 | surfel_point_size: T.Union[float, T.List[float]] = 1., |
| 731 | num_samples_per_pixel: int = 1, |
| 732 | neural_point_upsample_ratio_x48: int = 1, |
| 733 | total_nglod_epoch: int = 50, |
| 734 | nglod_test_every_iter: int = 50, |
| 735 | total_ngp_epoch: int = 50, |
| 736 | ngp_test_every_iter: int = 50, |
| 737 | total_dsnerf_iter: int = 50000, |
| 738 | dsnerf_test_every_iter: int = 5000, |
| 739 | test_plane_normal: bool = False, |
| 740 | ibrnet_chunk_size: int = 4096, |
| 741 | ): |
| 742 | """ |
| 743 | Main rendering function that calls different methods. |
| 744 | """ |
| 745 | if isinstance(model_filename, str): |
| 746 | model_filename = [model_filename] |
| 747 | |
| 748 | result_rgbd_dict = dict() # "name" -> rgbd_image |
| 749 | total_time_dict = dict() |
| 750 | pointersect_result_names = [] |
| 751 | # render with pointersect |
| 752 | if render_pointersect: |
| 753 | for idx in range(len(model_filename)): |
| 754 | print(f'---- Rendering with pointersect ({model_filename[idx]})----') |
| 755 | try: |
| 756 | pointersect_result = infer.render_point_cloud_camera_using_pointersect( |
| 757 | model_filename=model_filename[idx], |
| 758 | k=k, |
| 759 | point_cloud=input_point_cloud, |
no test coverage detected