Spaces:
Runtime error
Runtime error
Commit
·
5178ffd
1
Parent(s):
019ef7a
Fix saving and returning of output image
Browse files
app.py
CHANGED
|
@@ -104,8 +104,11 @@ with gr.Blocks(css=css) as demo:
|
|
| 104 |
|
| 105 |
pred_depth = pred_depth.cpu().numpy().squeeze()
|
| 106 |
output_image = plt.imsave('depth.png', pred_depth, cmap='jet')
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
submit.click(on_submit, inputs=[input_image], outputs=[
|
| 111 |
depth_image_slider, raw_file])
|
|
|
|
| 104 |
|
| 105 |
pred_depth = pred_depth.cpu().numpy().squeeze()
|
| 106 |
output_image = plt.imsave('depth.png', pred_depth, cmap='jet')
|
| 107 |
+
tmp = tempfile.NamedTemporaryFile(delete=False)
|
| 108 |
+
tmp.write(output_image)
|
| 109 |
+
print(tmp.read())
|
| 110 |
+
tmp_output = tmp.read()
|
| 111 |
+
return [(original_image, tmp_output), tmp_output]
|
| 112 |
|
| 113 |
submit.click(on_submit, inputs=[input_image], outputs=[
|
| 114 |
depth_image_slider, raw_file])
|