Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,8 @@ import json
|
|
| 12 |
from gradio_depth_pred import create_demo as create_depth_pred_demo
|
| 13 |
from gradio_im_to_3d import create_demo as create_im_to_3d_demo
|
| 14 |
|
|
|
|
|
|
|
| 15 |
#dpt_beit = pipeline(task = "depth-estimation", model="Intel/dpt-beit-base-384", device=0)
|
| 16 |
dpt_beit = pipeline(task = "depth-estimation", model="Intel/dpt-beit-large-512", device=0)
|
| 17 |
|
|
@@ -43,6 +45,15 @@ css = """
|
|
| 43 |
height: 500px;
|
| 44 |
overflow: auto;
|
| 45 |
border: 1px solid #ccc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
"""
|
| 48 |
|
|
@@ -82,15 +93,13 @@ with gr.Blocks(css=css) as demo:
|
|
| 82 |
|
| 83 |
input_img.change(infer, [input_img], [output_1, output_2, output_3])
|
| 84 |
|
| 85 |
-
with gr.Blocks(css=css
|
| 86 |
gr.Markdown(title)
|
| 87 |
gr.Markdown(description)
|
| 88 |
with gr.Tab("Depth Prediction"):
|
| 89 |
create_depth_pred_demo(model)
|
| 90 |
with gr.Tab("Image to 3D"):
|
| 91 |
create_im_to_3d_demo(model)
|
| 92 |
-
with gr.Tab("360 Panorama to 3D"):
|
| 93 |
-
create_pano_to_3d_demo(model)
|
| 94 |
|
| 95 |
gr.HTML('''<br><br><br><center>You can duplicate this Space to skip the queue:<a href="https://huggingface.co/spaces/shariqfarooq/ZoeDepth?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><br>
|
| 96 |
<p><img src="https://visitor-badge.glitch.me/badge?page_id=shariqfarooq.zoedepth_demo_hf" alt="visitors"></p></center>''')
|
|
|
|
| 12 |
from gradio_depth_pred import create_demo as create_depth_pred_demo
|
| 13 |
from gradio_im_to_3d import create_demo as create_im_to_3d_demo
|
| 14 |
|
| 15 |
+
model = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).to(DEVICE).eval()
|
| 16 |
+
|
| 17 |
#dpt_beit = pipeline(task = "depth-estimation", model="Intel/dpt-beit-base-384", device=0)
|
| 18 |
dpt_beit = pipeline(task = "depth-estimation", model="Intel/dpt-beit-large-512", device=0)
|
| 19 |
|
|
|
|
| 45 |
height: 500px;
|
| 46 |
overflow: auto;
|
| 47 |
border: 1px solid #ccc;
|
| 48 |
+
#img-display-container {
|
| 49 |
+
max-height: 50vh;
|
| 50 |
+
}
|
| 51 |
+
#img-display-input {
|
| 52 |
+
max-height: 40vh;
|
| 53 |
+
}
|
| 54 |
+
#img-display-output {
|
| 55 |
+
max-height: 40vh;
|
| 56 |
+
}
|
| 57 |
}
|
| 58 |
"""
|
| 59 |
|
|
|
|
| 93 |
|
| 94 |
input_img.change(infer, [input_img], [output_1, output_2, output_3])
|
| 95 |
|
| 96 |
+
with gr.Blocks(css=css) as demo:
|
| 97 |
gr.Markdown(title)
|
| 98 |
gr.Markdown(description)
|
| 99 |
with gr.Tab("Depth Prediction"):
|
| 100 |
create_depth_pred_demo(model)
|
| 101 |
with gr.Tab("Image to 3D"):
|
| 102 |
create_im_to_3d_demo(model)
|
|
|
|
|
|
|
| 103 |
|
| 104 |
gr.HTML('''<br><br><br><center>You can duplicate this Space to skip the queue:<a href="https://huggingface.co/spaces/shariqfarooq/ZoeDepth?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><br>
|
| 105 |
<p><img src="https://visitor-badge.glitch.me/badge?page_id=shariqfarooq.zoedepth_demo_hf" alt="visitors"></p></center>''')
|