Spaces:
Running
on
Zero
Running
on
Zero
Load models from Hugging Face
#9
by
nielsr
HF staff
- opened
app.py
CHANGED
@@ -10,7 +10,7 @@ from torchvision.transforms import Compose
|
|
10 |
import tempfile
|
11 |
from gradio_imageslider import ImageSlider
|
12 |
|
13 |
-
from depth_anything.dpt import
|
14 |
from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
|
15 |
|
16 |
css = """
|
@@ -25,8 +25,8 @@ css = """
|
|
25 |
}
|
26 |
"""
|
27 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
28 |
-
|
29 |
-
model.
|
30 |
|
31 |
title = "# Depth Anything"
|
32 |
description = """Official demo for **Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data**.
|
|
|
10 |
import tempfile
|
11 |
from gradio_imageslider import ImageSlider
|
12 |
|
13 |
+
from depth_anything.dpt import DepthAnything
|
14 |
from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
|
15 |
|
16 |
css = """
|
|
|
25 |
}
|
26 |
"""
|
27 |
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
28 |
+
encoder = 'vitl' # can also be 'vitb' or 'vitl'
|
29 |
+
model = DepthAnything.from_pretrained(f"LiheYoung/depth_anything_{encoder}14")
|
30 |
|
31 |
title = "# Depth Anything"
|
32 |
description = """Official demo for **Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data**.
|