Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,13 @@ DAMV2_configs = {
|
|
54 |
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
55 |
}
|
56 |
encoder = 'vitb' # or 'vits', 'vitb', 'vitl'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
DAMV2 = DepthAnythingV2(**DAMV2_configs[encoder])
|
58 |
filepath = hf_hub_download(repo_id=f"depth-anything/Depth-Anything-V2-{model_name}", filename=f"depth_anything_v2_{encoder}.pth", repo_type="model")
|
59 |
state_dict = torch.load(filepath, map_location="cpu")
|
|
|
54 |
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
55 |
}
|
56 |
encoder = 'vitb' # or 'vits', 'vitb', 'vitl'
|
57 |
+
encoder2name = {
|
58 |
+
'vits': 'Small',
|
59 |
+
'vitb': 'Base',
|
60 |
+
'vitl': 'Large',
|
61 |
+
'vitg': 'Giant', # we are undergoing company review procedures to release our giant model checkpoint
|
62 |
+
}
|
63 |
+
model_name = encoder2name[encoder]
|
64 |
DAMV2 = DepthAnythingV2(**DAMV2_configs[encoder])
|
65 |
filepath = hf_hub_download(repo_id=f"depth-anything/Depth-Anything-V2-{model_name}", filename=f"depth_anything_v2_{encoder}.pth", repo_type="model")
|
66 |
state_dict = torch.load(filepath, map_location="cpu")
|