Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
b7a1e25
1
Parent(s):
9917d3b
fix
Browse files
utils.py
CHANGED
@@ -53,7 +53,7 @@ def create_3d_obj(rgb_image, depth_image, depth=10):
|
|
53 |
return gltf_path
|
54 |
|
55 |
|
56 |
-
def create_3d_pc(rgb_image, depth_image,
|
57 |
depth_image = depth_image.astype(np.float32) # Convert depth map to float32
|
58 |
depth_o3d = o3d.geometry.Image(depth_image)
|
59 |
image_o3d = o3d.geometry.Image(rgb_image)
|
@@ -81,7 +81,7 @@ def create_3d_pc(rgb_image, depth_image, image_path, depth=10):
|
|
81 |
camera_location=np.array([0., 0., 1000.]))
|
82 |
|
83 |
# Save the point cloud as a PLY file
|
84 |
-
ply_path =
|
85 |
o3d.io.write_point_cloud(str(ply_path), pcd)
|
86 |
|
87 |
return str(ply_path) # Return the file path where the PLY file is saved
|
|
|
53 |
return gltf_path
|
54 |
|
55 |
|
56 |
+
def create_3d_pc(rgb_image, depth_image, depth=10):
|
57 |
depth_image = depth_image.astype(np.float32) # Convert depth map to float32
|
58 |
depth_o3d = o3d.geometry.Image(depth_image)
|
59 |
image_o3d = o3d.geometry.Image(rgb_image)
|
|
|
81 |
camera_location=np.array([0., 0., 1000.]))
|
82 |
|
83 |
# Save the point cloud as a PLY file
|
84 |
+
ply_path = "image".with_suffix('.ply')
|
85 |
o3d.io.write_point_cloud(str(ply_path), pcd)
|
86 |
|
87 |
return str(ply_path) # Return the file path where the PLY file is saved
|