upd
This commit is contained in:
@@ -84,10 +84,12 @@ class RenderUtil:
|
||||
params_data_path = os.path.join(temp_dir, "params.json")
|
||||
with open(params_data_path, 'w') as f:
|
||||
json.dump(params, f)
|
||||
#import ipdb; ipdb.set_trace()
|
||||
result = subprocess.run([
|
||||
'/home/hofee/blender-4.0.2-linux-x64/blender', '-b', '-P', script_path, '--', temp_dir
|
||||
], capture_output=True, text=True)
|
||||
#print(result)
|
||||
#import ipdb; ipdb.set_trace()
|
||||
path = os.path.join(temp_dir, "tmp")
|
||||
cam_info = DataLoadUtil.load_cam_info(path, binocular=True)
|
||||
depth_L, depth_R = DataLoadUtil.load_depth(
|
||||
|
18
utils/vis.py
18
utils/vis.py
@@ -7,6 +7,7 @@ import trimesh
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
from utils.data_load import DataLoadUtil
|
||||
from utils.pts import PtsUtil
|
||||
from utils.pose import PoseUtil
|
||||
|
||||
class visualizeUtil:
|
||||
|
||||
@@ -33,7 +34,22 @@ class visualizeUtil:
|
||||
all_cam_axis = np.array(all_cam_axis).reshape(-1, 3)
|
||||
np.savetxt(os.path.join(output_dir, "all_cam_pos.txt"), all_cam_pos)
|
||||
np.savetxt(os.path.join(output_dir, "all_cam_axis.txt"), all_cam_axis)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_cam_pose_and_cam_axis(cam_pose, is_6d_pose):
|
||||
if is_6d_pose:
|
||||
matrix_cam_pose = np.eye(4)
|
||||
matrix_cam_pose[:3,:3] = PoseUtil.rotation_6d_to_matrix_numpy(cam_pose[:6])
|
||||
matrix_cam_pose[:3, 3] = cam_pose[6:]
|
||||
else:
|
||||
matrix_cam_pose = cam_pose
|
||||
cam_pos = matrix_cam_pose[:3, 3]
|
||||
cam_axis = matrix_cam_pose[:3, 2]
|
||||
num_samples = 10
|
||||
sample_points = [cam_pos + 0.02*t * cam_axis for t in range(num_samples)]
|
||||
sample_points = np.array(sample_points)
|
||||
return cam_pos, sample_points
|
||||
|
||||
@staticmethod
|
||||
def save_all_combined_pts(root, scene, output_dir):
|
||||
length = DataLoadUtil.get_scene_seq_length(root, scene)
|
||||
|
Reference in New Issue
Block a user