Spaces:
Runtime error
Runtime error
Load models from Hugging Face (#9)
Browse files- Load models from Hugging Face (6b3f9ec8f6c43e3fa0c600e73a5b43401e515fd6)
Co-authored-by: Niels Rogge <[email protected]>
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**.
|