Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,11 +50,14 @@ def process_frame(image):
|
|
50 |
depth_map = manual_normalize(depth_map)
|
51 |
|
52 |
depth_map_colored = cv2.applyColorMap(depth_map, color_map)
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
interface = gr.Interface(
|
56 |
fn=process_frame,
|
57 |
-
inputs=gr.Image(
|
58 |
outputs="image",
|
59 |
live=True
|
60 |
)
|
|
|
50 |
depth_map = manual_normalize(depth_map)
|
51 |
|
52 |
depth_map_colored = cv2.applyColorMap(depth_map, color_map)
|
53 |
+
depth_map_colored = cv2.resize(depth_map_colored, (image.shape[1], image.shape[0]))
|
54 |
+
|
55 |
+
combined = np.hstack((image, depth_map_colored))
|
56 |
+
return cv2.cvtColor(combined, cv2.COLOR_BGR2RGB)
|
57 |
|
58 |
interface = gr.Interface(
|
59 |
fn=process_frame,
|
60 |
+
inputs=gr.Image(source="webcam", streaming=True),
|
61 |
outputs="image",
|
62 |
live=True
|
63 |
)
|