alexnasa commited on
Commit
d897172
·
verified ·
1 Parent(s): 6d367b8

Update src/pixel3dmm/preprocessing/MICA/utils/masking.py

Browse files
src/pixel3dmm/preprocessing/MICA/utils/masking.py CHANGED
@@ -15,7 +15,8 @@
15
  # Contact: [email protected]
16
  import os
17
  import pickle
18
- from huggingface_hub import hf_hub_download
 
19
 
20
  import numpy as np
21
  import torch
@@ -47,15 +48,8 @@ class Masking(nn.Module):
47
  with open(f'{ROOT_DIR}/data/FLAME2020/FLAME_masks/FLAME_masks.pkl', 'rb') as f:
48
  ss = pickle.load(f, encoding='latin1')
49
  self.masks = Struct(**ss)
50
-
51
-
52
- local_path = hf_hub_download(
53
- repo_id="alexnasa/pixel3dmm",
54
- filename="FLAME/generic_model.pkl",
55
- repo_type="model",
56
- )
57
 
58
- with open(local_path, 'rb') as f:
59
  ss = pickle.load(f, encoding='latin1')
60
  flame_model = Struct(**ss)
61
 
 
15
  # Contact: [email protected]
16
  import os
17
  import pickle
18
+ from pixel3dmm import env_paths
19
+
20
 
21
  import numpy as np
22
  import torch
 
48
  with open(f'{ROOT_DIR}/data/FLAME2020/FLAME_masks/FLAME_masks.pkl', 'rb') as f:
49
  ss = pickle.load(f, encoding='latin1')
50
  self.masks = Struct(**ss)
 
 
 
 
 
 
 
51
 
52
+ with open(f'{env_paths.FLAME_ASSETS}', 'rb') as f:
53
  ss = pickle.load(f, encoding='latin1')
54
  flame_model = Struct(**ss)
55