Spaces:
Running
on
Zero
Running
on
Zero
Update src/pixel3dmm/utils/masking.py
Browse files
src/pixel3dmm/utils/masking.py
CHANGED
@@ -15,6 +15,7 @@
|
|
15 |
# Contact: [email protected]
|
16 |
|
17 |
import os
|
|
|
18 |
import pickle
|
19 |
|
20 |
import numpy as np
|
@@ -52,7 +53,14 @@ class Masking(nn.Module):
|
|
52 |
ss = pickle.load(f, encoding='latin1')
|
53 |
self.masks = Struct(**ss)
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
ss = pickle.load(f, encoding='latin1')
|
57 |
flame_model = Struct(**ss)
|
58 |
|
|
|
15 |
# Contact: [email protected]
|
16 |
|
17 |
import os
|
18 |
+
from huggingface_hub import hf_hub_download
|
19 |
import pickle
|
20 |
|
21 |
import numpy as np
|
|
|
53 |
ss = pickle.load(f, encoding='latin1')
|
54 |
self.masks = Struct(**ss)
|
55 |
|
56 |
+
|
57 |
+
local_path = hf_hub_download(
|
58 |
+
repo_id="alexnasa/pixel3dmm",
|
59 |
+
filename="FLAME/generic_model.pkl",
|
60 |
+
repo_type="model",
|
61 |
+
)
|
62 |
+
|
63 |
+
with open(local_path, 'rb') as f:
|
64 |
ss = pickle.load(f, encoding='latin1')
|
65 |
flame_model = Struct(**ss)
|
66 |
|