Spaces:
Runtime error
Runtime error
Commit
·
e74e489
1
Parent(s):
8435b21
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
import torch
|
| 5 |
+
from utils import get_image_from_url, colorize
|
| 6 |
+
from PIL import Image
|
| 7 |
+
import matplotlib.pyplot as plt
|
| 8 |
+
|
| 9 |
+
title = "Interactive demo: ZoeDepth"
|
| 10 |
+
description = "Unofficial Gradio Demo for using ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth. To use it, simply upload an image or use one of the examples below and click 'Submit'. Results will show up in a few seconds."
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
zoe = torch.hub.load(".", "ZoeD_N", source="local", pretrained=True)
|
| 14 |
+
def process_image(raw_image):
|
| 15 |
+
return raw_image
|
| 16 |
+
interface = gr.Interface(fn=process_image,
|
| 17 |
+
inputs=[gr.Image(type="pil")],
|
| 18 |
+
outputs=[gr.Image(type="pil", label ="Depth")
|
| 19 |
+
],
|
| 20 |
+
title=title,
|
| 21 |
+
description=description,
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
interface.launch(debug=True)
|