Update app.py
Browse files
app.py
CHANGED
@@ -18,37 +18,38 @@ token = os.environ['model_fetch']
|
|
18 |
|
19 |
opt = SwapOptions().parse()
|
20 |
|
21 |
-
retina_repo = Repository(local_dir="
|
22 |
|
23 |
from retina_model.models import *
|
24 |
|
25 |
-
RetinaFace = load_model("retina_model/
|
26 |
custom_objects={"FPN": FPN,
|
27 |
"SSH": SSH,
|
28 |
"BboxHead": BboxHead,
|
29 |
"LandmarkHead": LandmarkHead,
|
30 |
"ClassHead": ClassHead})
|
31 |
|
32 |
-
arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/
|
33 |
-
ArcFace = load_model("arcface_model/
|
34 |
-
ArcFaceE = load_model("arcface_model/
|
35 |
|
36 |
-
|
37 |
-
|
|
|
38 |
"AdaptiveAttention": AdaptiveAttention,
|
39 |
"InstanceNormalization": InstanceNormalization})
|
40 |
|
41 |
-
r_repo = Repository(local_dir="reconstruction_attack", clone_from="felixrosberg/reconstruction_attack", use_auth_token=token)
|
42 |
-
R = load_model("reconstruction_attack/reconstructor_42.h5", custom_objects={"AdaIN": AdaIN,
|
43 |
-
|
44 |
-
|
45 |
|
46 |
-
permuter_repo = Repository(local_dir="identity_permuter", clone_from="felixrosberg/identitypermuter", use_auth_token=token, git_user="felixrosberg")
|
47 |
|
48 |
-
from identity_permuter.id_permuter import identity_permuter
|
49 |
|
50 |
-
IDP = identity_permuter(emb_size=32, min_arg=False)
|
51 |
-
IDP.load_weights("identity_permuter/id_permuter.h5")
|
52 |
|
53 |
blend_mask_base = np.zeros(shape=(256, 256, 1))
|
54 |
blend_mask_base[80:244, 32:224] = 1
|
|
|
18 |
|
19 |
opt = SwapOptions().parse()
|
20 |
|
21 |
+
retina_repo = Repository(local_dir="retina_models", clone_from="felixrosberg/RetinaFace")
|
22 |
|
23 |
from retina_model.models import *
|
24 |
|
25 |
+
RetinaFace = load_model("retina_model/RetinaFace-Res50.h5",
|
26 |
custom_objects={"FPN": FPN,
|
27 |
"SSH": SSH,
|
28 |
"BboxHead": BboxHead,
|
29 |
"LandmarkHead": LandmarkHead,
|
30 |
"ClassHead": ClassHead})
|
31 |
|
32 |
+
arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/ArcFace")
|
33 |
+
ArcFace = load_model("arcface_model/ArcFace-Res50.h5")
|
34 |
+
ArcFaceE = load_model("arcface_model/ArcFacePerceptual-Res50.h5")
|
35 |
|
36 |
+
|
37 |
+
g_repo = Repository(local_dir="g_model_c_hq", clone_from="felixrosberg/FaceDancer",use_auth_token=token)
|
38 |
+
G = load_model("g_model_c_hq/FaceDancer_config_c_HQ.h5", custom_objects={"AdaIN": AdaIN,
|
39 |
"AdaptiveAttention": AdaptiveAttention,
|
40 |
"InstanceNormalization": InstanceNormalization})
|
41 |
|
42 |
+
# r_repo = Repository(local_dir="reconstruction_attack", clone_from="felixrosberg/reconstruction_attack", use_auth_token=token)
|
43 |
+
# R = load_model("reconstruction_attack/reconstructor_42.h5", custom_objects={"AdaIN": AdaIN,
|
44 |
+
# "AdaptiveAttention": AdaptiveAttention,
|
45 |
+
# "InstanceNormalization": InstanceNormalization})
|
46 |
|
47 |
+
# permuter_repo = Repository(local_dir="identity_permuter", clone_from="felixrosberg/identitypermuter", use_auth_token=token, git_user="felixrosberg")
|
48 |
|
49 |
+
# from identity_permuter.id_permuter import identity_permuter
|
50 |
|
51 |
+
# IDP = identity_permuter(emb_size=32, min_arg=False)
|
52 |
+
# IDP.load_weights("identity_permuter/id_permuter.h5")
|
53 |
|
54 |
blend_mask_base = np.zeros(shape=(256, 256, 1))
|
55 |
blend_mask_base[80:244, 32:224] = 1
|