Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
afd1abe
1
Parent(s):
dd26c52
fix
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ with block:
|
|
50 |
sam_decode_btn, depth_reconstruction_btn, masks_annotated_image}
|
51 |
def on_depth_reconstruction_btn_click(inputs):
|
52 |
print("depth reconstruction")
|
53 |
-
image =
|
54 |
# depth reconstruction
|
55 |
fig = generate_PCL(image)
|
56 |
return {pcl_figure: fig}
|
|
|
50 |
sam_decode_btn, depth_reconstruction_btn, masks_annotated_image}
|
51 |
def on_depth_reconstruction_btn_click(inputs):
|
52 |
print("depth reconstruction")
|
53 |
+
image = inputs[raw_image]
|
54 |
# depth reconstruction
|
55 |
fig = generate_PCL(image)
|
56 |
return {pcl_figure: fig}
|
utils.py
CHANGED
@@ -144,6 +144,7 @@ def array_PCL(rgb_image, depth_image):
|
|
144 |
def generate_PCL(image):
|
145 |
depth_predictor = DepthPredictor()
|
146 |
depth_result = depth_predictor.predict(image)
|
|
|
147 |
pcd, colors = array_PCL(image, depth_result)
|
148 |
fig = px.scatter_3d(x=pcd[:, 0], y=pcd[:, 1], z=pcd[:, 2], color=colors, size_max=0.1)
|
149 |
return fig
|
|
|
144 |
def generate_PCL(image):
|
145 |
depth_predictor = DepthPredictor()
|
146 |
depth_result = depth_predictor.predict(image)
|
147 |
+
image = np.array(image)
|
148 |
pcd, colors = array_PCL(image, depth_result)
|
149 |
fig = px.scatter_3d(x=pcd[:, 0], y=pcd[:, 1], z=pcd[:, 2], color=colors, size_max=0.1)
|
150 |
return fig
|