Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
04f866e
1
Parent(s):
86b1d43
Reduce requested runtime.
Browse files
app.py
CHANGED
@@ -30,14 +30,12 @@ DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
30 |
model_configs = {
|
31 |
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
32 |
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
33 |
-
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]}
|
34 |
-
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
35 |
}
|
36 |
encoder2name = {
|
37 |
'vits': 'Small',
|
38 |
'vitb': 'Base',
|
39 |
-
'vitl': 'Large'
|
40 |
-
'vitg': 'Giant', # we are undergoing company review procedures to release our giant model checkpoint
|
41 |
}
|
42 |
encoder = 'vitb'
|
43 |
model_name = encoder2name[encoder]
|
@@ -51,7 +49,7 @@ title = "# Depth Anything V2"
|
|
51 |
description = """This is a slow alternative endpoint for **Depth Anything V2**, which is not mine.
|
52 |
Please refer to the official [project page](https://depth-anything-v2.github.io), and [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
|
53 |
|
54 |
-
@spaces.GPU
|
55 |
def predict_depth(image):
|
56 |
return model.infer_image(image)
|
57 |
|
|
|
30 |
model_configs = {
|
31 |
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
32 |
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
33 |
+
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]}
|
|
|
34 |
}
|
35 |
encoder2name = {
|
36 |
'vits': 'Small',
|
37 |
'vitb': 'Base',
|
38 |
+
'vitl': 'Large'
|
|
|
39 |
}
|
40 |
encoder = 'vitb'
|
41 |
model_name = encoder2name[encoder]
|
|
|
49 |
description = """This is a slow alternative endpoint for **Depth Anything V2**, which is not mine.
|
50 |
Please refer to the official [project page](https://depth-anything-v2.github.io), and [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
|
51 |
|
52 |
+
@spaces.GPU(duration=6)
|
53 |
def predict_depth(image):
|
54 |
return model.infer_image(image)
|
55 |
|