felixrosberg commited on
Commit
fae5def
β€’
1 Parent(s): e46b601
Files changed (2) hide show
  1. app.py +8 -8
  2. networks/layers.py +0 -0
app.py CHANGED
@@ -1,11 +1,8 @@
1
  import gradio
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
8
- from networks.layers import AdaIN,
9
  import numpy as np
10
  import cv2
11
  from scipy.ndimage import gaussian_filter
@@ -18,7 +15,8 @@ from options.swap_options import SwapOptions
18
  opt = SwapOptions().parse()
19
 
20
 
21
- retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50", private=True, use_auth_token="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")
 
22
  RetinaFace = load_model("retina_model/retinaface_res50.h5",
23
  custom_objects={"FPN": FPN,
24
  "SSH": SSH,
@@ -26,10 +24,12 @@ RetinaFace = load_model("retina_model/retinaface_res50.h5",
26
  "LandmarkHead": LandmarkHead,
27
  "ClassHead": ClassHead})
28
 
29
- arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcface_tf", private=True, use_auth_token="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")
 
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))
 
1
  import gradio
 
 
2
  from huggingface_hub import Repository
3
 
4
+ from utils.utils import norm_crop, estimate_norm, inverse_estimate_norm, transform_landmark_points, get_lm
5
+ from networks.layers import AdaIN, AdaptiveAttention
 
6
  import numpy as np
7
  import cv2
8
  from scipy.ndimage import gaussian_filter
 
15
  opt = SwapOptions().parse()
16
 
17
 
18
+ retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50",
19
+ private=True, use_auth_token="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")
20
  RetinaFace = load_model("retina_model/retinaface_res50.h5",
21
  custom_objects={"FPN": FPN,
22
  "SSH": SSH,
 
24
  "LandmarkHead": LandmarkHead,
25
  "ClassHead": ClassHead})
26
 
27
+ arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcface_tf",
28
+ 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",
32
+ 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))
networks/layers.py CHANGED
The diff for this file is too large to render. See raw diff