Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -33,13 +33,13 @@ from mono.utils.transform import gray_to_colormap
|
|
33 |
from mono.utils.visualization import vis_surface_normal
|
34 |
import gradio as gr
|
35 |
|
36 |
-
cfg = Config.fromfile('./mono/configs/HourglassDecoder/vit.raft5.
|
37 |
|
38 |
torch.hub.download_url_to_file('https://images.unsplash.com/photo-1437622368342-7a3d73a34c8f', 'turtle.jpg')
|
39 |
torch.hub.download_url_to_file('https://images.unsplash.com/photo-1519066629447-267fffa62d4b', 'lions.jpg')
|
40 |
|
41 |
model = get_configured_monodepth_model(cfg, )
|
42 |
-
model, _, _, _ = load_ckpt('./weight/
|
43 |
model.eval()
|
44 |
|
45 |
device = "cpu"
|
@@ -85,9 +85,9 @@ def depth_normal(img):
|
|
85 |
#depth = gr.outputs.Image(type="pil",label="Output Depth")
|
86 |
#normal = gr.outputs.Image(type="pil",label="Output Normal")
|
87 |
|
88 |
-
title = "
|
89 |
-
description = "Gradio demo for
|
90 |
-
article = "<p style='text-align: center'><a href='https://arxiv.org/pdf/2307.10984.pdf'>
|
91 |
|
92 |
examples = [
|
93 |
["turtle.jpg"],
|
|
|
33 |
from mono.utils.visualization import vis_surface_normal
|
34 |
import gradio as gr
|
35 |
|
36 |
+
cfg = Config.fromfile('./mono/configs/HourglassDecoder/vit.raft5.large.py')
|
37 |
|
38 |
torch.hub.download_url_to_file('https://images.unsplash.com/photo-1437622368342-7a3d73a34c8f', 'turtle.jpg')
|
39 |
torch.hub.download_url_to_file('https://images.unsplash.com/photo-1519066629447-267fffa62d4b', 'lions.jpg')
|
40 |
|
41 |
model = get_configured_monodepth_model(cfg, )
|
42 |
+
model, _, _, _ = load_ckpt('./weight/metric_depth_vit_large_800k.pth', model, strict_match=False)
|
43 |
model.eval()
|
44 |
|
45 |
device = "cpu"
|
|
|
85 |
#depth = gr.outputs.Image(type="pil",label="Output Depth")
|
86 |
#normal = gr.outputs.Image(type="pil",label="Output Normal")
|
87 |
|
88 |
+
title = "Metric3D"
|
89 |
+
description = "Gradio demo for Metric3D (vit-large) running on CPU which takes in a single image for computing metric depth and surface normal. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
|
90 |
+
article = "<p style='text-align: center'><a href='https://arxiv.org/pdf/2307.10984.pdf'>Metric3D: Towards Zero-shot Metric 3D Prediction from A Single Image</a> | <a href='https://github.com/YvanYin/Metric3D'>Github Repo</a></p>"
|
91 |
|
92 |
examples = [
|
93 |
["turtle.jpg"],
|