Spaces:
Running
Running
felixrosberg
commited on
Commit
Β·
e46b601
1
Parent(s):
b4d87fe
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from huggingface_hub import Repository
|
|
5 |
|
6 |
from utils.utils import norm_crop, estimate_norm, inverse_estimate_norm, transform_landmark_points, get_lm, load_model_internal
|
7 |
from networks.generator import get_generator
|
|
|
8 |
import numpy as np
|
9 |
import cv2
|
10 |
from scipy.ndimage import gaussian_filter
|
@@ -29,7 +30,7 @@ arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcfac
|
|
29 |
ArcFace = load_model("arcface_model/arc_res50.h5")
|
30 |
|
31 |
g_repo = Repository(local_dir="g_model", clone_from="felixrosberg/affa_f", private=True, use_auth_token="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")
|
32 |
-
G = load_model("g_model/affa_f_demo.h5")
|
33 |
|
34 |
blend_mask_base = np.zeros(shape=(256, 256, 1))
|
35 |
blend_mask_base[100:240, 32:224] = 1
|
|
|
5 |
|
6 |
from utils.utils import norm_crop, estimate_norm, inverse_estimate_norm, transform_landmark_points, get_lm, load_model_internal
|
7 |
from networks.generator import get_generator
|
8 |
+
from networks.layers import AdaIN,
|
9 |
import numpy as np
|
10 |
import cv2
|
11 |
from scipy.ndimage import gaussian_filter
|
|
|
30 |
ArcFace = load_model("arcface_model/arc_res50.h5")
|
31 |
|
32 |
g_repo = Repository(local_dir="g_model", clone_from="felixrosberg/affa_f", private=True, use_auth_token="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")
|
33 |
+
G = load_model("g_model/affa_f_demo.h5", custom_objects={"AdaIN": AdaIN, "AdaptiveAttention": AdaptiveAttention})
|
34 |
|
35 |
blend_mask_base = np.zeros(shape=(256, 256, 1))
|
36 |
blend_mask_base[100:240, 32:224] = 1
|