Spaces:
Running
on
Zero
Running
on
Zero
Update src/pixel3dmm/preprocessing/MICA/utils/masking.py
Browse files
src/pixel3dmm/preprocessing/MICA/utils/masking.py
CHANGED
@@ -15,6 +15,7 @@
|
|
15 |
# Contact: [email protected]
|
16 |
import os
|
17 |
import pickle
|
|
|
18 |
|
19 |
import numpy as np
|
20 |
import torch
|
@@ -47,7 +48,14 @@ class Masking(nn.Module):
|
|
47 |
ss = pickle.load(f, encoding='latin1')
|
48 |
self.masks = Struct(**ss)
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
ss = pickle.load(f, encoding='latin1')
|
52 |
flame_model = Struct(**ss)
|
53 |
|
|
|
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
|
|
|
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 |
|