Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ img {
|
|
| 16 |
}
|
| 17 |
"""
|
| 18 |
|
|
|
|
| 19 |
# DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 20 |
MODEL = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).eval()
|
| 21 |
|
|
@@ -44,13 +45,41 @@ def process_image(image: Image.Image):
|
|
| 44 |
|
| 45 |
# ----------- Depth functions
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
with gr.Blocks(css=css) as API:
|
| 52 |
gr.Markdown(title)
|
| 53 |
-
gr.Markdown(description)
|
| 54 |
with gr.Tab("Depth Prediction"):
|
| 55 |
with gr.Row():
|
| 56 |
inputs=gr.Image(label="Input Image", type='pil', height=500) # Input is an image
|
|
|
|
| 16 |
}
|
| 17 |
"""
|
| 18 |
|
| 19 |
+
|
| 20 |
# DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 21 |
MODEL = torch.hub.load('isl-org/ZoeDepth', "ZoeD_N", pretrained=True).eval()
|
| 22 |
|
|
|
|
| 45 |
|
| 46 |
# ----------- Depth functions
|
| 47 |
|
| 48 |
+
title="""
|
| 49 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;">
|
| 50 |
+
<div style="
|
| 51 |
+
display: inline-flex;
|
| 52 |
+
flex-direction: column;
|
| 53 |
+
align-items: center;
|
| 54 |
+
gap: 0.8rem;
|
| 55 |
+
font-size: 1.75rem;
|
| 56 |
+
margin-bottom: 10px;
|
| 57 |
+
">
|
| 58 |
+
<h1 style="font-weight: 600; text-wrap: nowrap; margin-bottom: 0px;">
|
| 59 |
+
Depth Prediction 🧊
|
| 60 |
+
</h1>
|
| 61 |
+
<p style="font-size: 16px; margin-bottom: 5px;">Unofficial demo for **ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth**.</p>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
<div style="text-align: center; font-family: sans-serif; padding: 30px;">
|
| 65 |
+
<h2>🚀 Check out <a href="http://tools3ox.com" target="_blank" style="color: #007bff;">Tools3ox.com</a></h2>
|
| 66 |
+
<p style="font-size: 18px; color: #333;">
|
| 67 |
+
Handy tools. Smart features. No fluff.<br>
|
| 68 |
+
Made for creators, coders, and curious minds.
|
| 69 |
+
</p>
|
| 70 |
+
<a href="http://tools3ox.com" target="_blank">
|
| 71 |
+
<button style="margin-top: 15px; padding: 10px 20px; font-size: 16px; background: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;">
|
| 72 |
+
👉 Visit Tools3ox
|
| 73 |
+
</button>
|
| 74 |
+
</a>
|
| 75 |
+
</div>
|
| 76 |
+
"""
|
| 77 |
+
# title = "# ZoeDepth"
|
| 78 |
+
# description = """Unofficial demo for **ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth**."""
|
| 79 |
|
| 80 |
with gr.Blocks(css=css) as API:
|
| 81 |
gr.Markdown(title)
|
| 82 |
+
# gr.Markdown(description)
|
| 83 |
with gr.Tab("Depth Prediction"):
|
| 84 |
with gr.Row():
|
| 85 |
inputs=gr.Image(label="Input Image", type='pil', height=500) # Input is an image
|