yotamsapi commited on
Commit
dea2840
β€’
1 Parent(s): c873df0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -18,37 +18,38 @@ token = os.environ['model_fetch']
18
 
19
  opt = SwapOptions().parse()
20
 
21
- retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50", use_auth_token=token)
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_tf", use_auth_token=token)
33
- ArcFace = load_model("arcface_model/arc_res50.h5")
34
- ArcFaceE = load_model("arcface_model/arc_res50e.h5")
35
 
36
- g_repo = Repository(local_dir="g_model_c_hq", clone_from="felixrosberg/affa_config_c_hq", use_auth_token=token)
37
- G = load_model("g_model_c_hq/generator_t_28.h5", custom_objects={"AdaIN": AdaIN,
 
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
- "AdaptiveAttention": AdaptiveAttention,
44
- "InstanceNormalization": InstanceNormalization})
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