bykang commited on
Commit
48d0430
1 Parent(s): 02d2686

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -40,8 +40,9 @@ encoder2name = {
40
  'vitg': 'Gaint',
41
  }
42
  encoder = 'vitg'
 
43
  model = DepthAnythingV2(**model_configs[encoder])
44
- filepath = hf_hub_download(repo_id=f"depth-anything/Depth-Anything-V2-{encoder2name[encoder]}", filename=f"model.pth", repo_type="model")
45
  state_dict = torch.load(filepath, map_location="cpu")
46
  model.load_state_dict(state_dict)
47
  model = model.to(DEVICE).eval()
 
40
  'vitg': 'Gaint',
41
  }
42
  encoder = 'vitg'
43
+ model_name = encoder2name[encoder]
44
  model = DepthAnythingV2(**model_configs[encoder])
45
+ filepath = hf_hub_download(repo_id=f"depth-anything/Depth-Anything-V2-{model_name}", filename=f"depth_anything_v2_{model_name.lower()}.pth", repo_type="model")
46
  state_dict = torch.load(filepath, map_location="cpu")
47
  model.load_state_dict(state_dict)
48
  model = model.to(DEVICE).eval()