From 865ae6d329513f3069549262e3a6c754b996212b Mon Sep 17 00:00:00 2001 From: hofee Date: Tue, 24 Sep 2024 14:23:13 +0800 Subject: [PATCH] add display_table_height in renderUtil --- configs/local/inference_config.yaml | 10 +++++----- utils/render.py | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configs/local/inference_config.yaml b/configs/local/inference_config.yaml index 4cc4e01..73a73de 100644 --- a/configs/local/inference_config.yaml +++ b/configs/local/inference_config.yaml @@ -6,21 +6,21 @@ runner: cuda_visible_devices: "0,1,2,3,4,5,6,7" experiment: - name: local_eval + name: local_full_eval root_dir: "experiments" - epoch: 555 # -1 stands for last epoch + epoch: 20 # -1 stands for last epoch test: dataset_list: - OmniObject3d_train blender_script_path: "/media/hofee/data/project/python/nbv_reconstruction/blender/data_renderer.py" - output_dir: "/media/hofee/data/project/python/nbv_reconstruction/sample_for_training/inference_result2" + output_dir: "/media/hofee/data/project/python/nbv_reconstruction/sample_for_training/inference_result_full" pipeline: nbv_reconstruction_pipeline dataset: OmniObject3d_train: - root_dir: "/media/hofee/data/project/python/nbv_reconstruction/sample_for_training/sample_preprocessed_scenes" + root_dir: "/media/hofee/repository/nbv_reconstruction_data_512" model_dir: "/media/hofee/data/data/scaled_object_meshes" source: seq_nbv_reconstruction_dataset split_file: "/media/hofee/data/project/python/nbv_reconstruction/sample_for_training/OmniObject3d_train.txt" @@ -30,7 +30,7 @@ dataset: batch_size: 1 num_workers: 12 pts_num: 4096 - load_from_preprocess: True + load_from_preprocess: False pipeline: nbv_reconstruction_pipeline: diff --git a/utils/render.py b/utils/render.py index 1b3c5a3..bede42d 100644 --- a/utils/render.py +++ b/utils/render.py @@ -3,13 +3,14 @@ import os import json import subprocess import tempfile +import shutil from utils.data_load import DataLoadUtil from utils.reconstruction import ReconstructionUtil from utils.pts import PtsUtil class RenderUtil: @staticmethod - def render_pts(cam_pose, scene_path,script_path, model_points_normals, voxel_threshold=0.005, filter_degree=75, nO_to_nL_pose=None, require_full_scene=False): + def render_pts(cam_pose, scene_path, script_path, model_points_normals, voxel_threshold=0.005, filter_degree=75, nO_to_nL_pose=None, require_full_scene=False): nO_to_world_pose = DataLoadUtil.get_real_cam_O_from_cam_L(cam_pose, nO_to_nL_pose, scene_path=scene_path) @@ -19,6 +20,8 @@ class RenderUtil: "cam_pose": nO_to_world_pose.tolist(), "scene_path": scene_path } + scene_info_path = os.path.join(scene_path, "scene_info.json") + shutil.copy(scene_info_path, os.path.join(temp_dir, "scene_info.json")) params_data_path = os.path.join(temp_dir, "params.json") with open(params_data_path, 'w') as f: json.dump(params, f) @@ -30,6 +33,9 @@ class RenderUtil: print(result.stderr) return None path = os.path.join(temp_dir, "tmp") + # ------ Debug Start ------ + import ipdb;ipdb.set_trace() + # ------ Debug End ------ point_cloud = DataLoadUtil.get_target_point_cloud_world_from_path(path, binocular=True) cam_params = DataLoadUtil.load_cam_info(path, binocular=True) filtered_point_cloud = ReconstructionUtil.filter_points(point_cloud, model_points_normals, cam_pose=cam_params["cam_to_world"], voxel_size=voxel_threshold, theta=filter_degree)