Spaces:
Running
Running
felixrosberg
commited on
Commit
β’
b4d87fe
1
Parent(s):
ac23e10
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import gradio
|
|
2 |
|
3 |
import tensorflow as tf
|
4 |
from huggingface_hub import Repository
|
5 |
-
repo = Repository()
|
6 |
|
7 |
from utils.utils import norm_crop, estimate_norm, inverse_estimate_norm, transform_landmark_points, get_lm, load_model_internal
|
8 |
from networks.generator import get_generator
|
@@ -18,18 +17,19 @@ from options.swap_options import SwapOptions
|
|
18 |
opt = SwapOptions().parse()
|
19 |
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
RetinaFace = load_model(opt.retina_path,
|
25 |
custom_objects={"FPN": FPN,
|
26 |
"SSH": SSH,
|
27 |
"BboxHead": BboxHead,
|
28 |
"LandmarkHead": LandmarkHead,
|
29 |
"ClassHead": ClassHead})
|
30 |
-
ArcFace = load_model(opt.arcface_path)
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
|
34 |
blend_mask_base = np.zeros(shape=(256, 256, 1))
|
35 |
blend_mask_base[100:240, 32:224] = 1
|
|
|
2 |
|
3 |
import tensorflow as tf
|
4 |
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
|
|
|
17 |
opt = SwapOptions().parse()
|
18 |
|
19 |
|
20 |
+
retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50", private=True, use_auth_token="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")
|
21 |
+
RetinaFace = load_model("retina_model/retinaface_res50.h5",
|
|
|
|
|
22 |
custom_objects={"FPN": FPN,
|
23 |
"SSH": SSH,
|
24 |
"BboxHead": BboxHead,
|
25 |
"LandmarkHead": LandmarkHead,
|
26 |
"ClassHead": ClassHead})
|
|
|
27 |
|
28 |
+
arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcface_tf", private=True, use_auth_token="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")
|
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
|