Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
9a4514d
1
Parent(s):
ba9eb63
fix
Browse files
utils.py
CHANGED
@@ -156,10 +156,13 @@ def plot_PCL(rgb_image, depth_image):
|
|
156 |
return fig
|
157 |
|
158 |
|
159 |
-
def PCL3(
|
|
|
|
|
|
|
160 |
# Step 2: Create an RGBD image from the RGB and depth image
|
161 |
-
depth_o3d = o3d.geometry.Image(
|
162 |
-
image_o3d = o3d.geometry.Image(
|
163 |
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(image_o3d, depth_o3d, convert_rgb_to_intensity=False)
|
164 |
# Step 3: Create a PointCloud from the RGBD image
|
165 |
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, o3d.camera.PinholeCameraIntrinsic(o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
|
|
|
156 |
return fig
|
157 |
|
158 |
|
159 |
+
def PCL3(image):
|
160 |
+
depth_predictor = DepthPredictor()
|
161 |
+
depth_result = depth_predictor.predict(image)
|
162 |
+
image = np.array(image)
|
163 |
# Step 2: Create an RGBD image from the RGB and depth image
|
164 |
+
depth_o3d = o3d.geometry.Image(depth_result)
|
165 |
+
image_o3d = o3d.geometry.Image(image)
|
166 |
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(image_o3d, depth_o3d, convert_rgb_to_intensity=False)
|
167 |
# Step 3: Create a PointCloud from the RGBD image
|
168 |
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, o3d.camera.PinholeCameraIntrinsic(o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
|