sanket kheni
commited on
Commit
•
3bb30d1
1
Parent(s):
e20f0de
app.py
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
import gradio
|
2 |
-
from huggingface_hub import Repository
|
3 |
import os
|
4 |
|
5 |
-
from utils.utils import norm_crop, estimate_norm, inverse_estimate_norm, transform_landmark_points, get_lm
|
6 |
-
from networks.layers import AdaIN, AdaptiveAttention
|
7 |
-
from tensorflow_addons.layers import InstanceNormalization
|
8 |
-
import numpy as np
|
9 |
import cv2
|
|
|
|
|
|
|
10 |
from scipy.ndimage import gaussian_filter
|
11 |
-
|
12 |
from tensorflow.keras.models import load_model
|
|
|
|
|
|
|
13 |
from options.swap_options import SwapOptions
|
|
|
|
|
14 |
|
15 |
# .
|
16 |
token = os.environ['model_fetch']
|
17 |
|
18 |
opt = SwapOptions().parse()
|
19 |
|
20 |
-
retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/
|
21 |
-
private=True, use_auth_token=token, git_user="felixrosberg")
|
22 |
|
23 |
from retina_model.models import *
|
24 |
|
@@ -29,8 +29,7 @@ RetinaFace = load_model("retina_model/retinaface_res50.h5",
|
|
29 |
"LandmarkHead": LandmarkHead,
|
30 |
"ClassHead": ClassHead})
|
31 |
|
32 |
-
arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/
|
33 |
-
private=True, use_auth_token=token)
|
34 |
ArcFace = load_model("arcface_model/arc_res50.h5")
|
35 |
ArcFaceE = load_model("arcface_model/arc_res50e.h5")
|
36 |
|
|
|
|
|
|
|
1 |
import os
|
2 |
|
|
|
|
|
|
|
|
|
3 |
import cv2
|
4 |
+
import gradio
|
5 |
+
import numpy as np
|
6 |
+
from huggingface_hub import Repository
|
7 |
from scipy.ndimage import gaussian_filter
|
|
|
8 |
from tensorflow.keras.models import load_model
|
9 |
+
from tensorflow_addons.layers import InstanceNormalization
|
10 |
+
|
11 |
+
from networks.layers import AdaIN, AdaptiveAttention
|
12 |
from options.swap_options import SwapOptions
|
13 |
+
from utils.utils import (estimate_norm, get_lm, inverse_estimate_norm,
|
14 |
+
norm_crop, transform_landmark_points)
|
15 |
|
16 |
# .
|
17 |
token = os.environ['model_fetch']
|
18 |
|
19 |
opt = SwapOptions().parse()
|
20 |
|
21 |
+
retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/RetinaFace")
|
|
|
22 |
|
23 |
from retina_model.models import *
|
24 |
|
|
|
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/arc_res50.h5")
|
34 |
ArcFaceE = load_model("arcface_model/arc_res50e.h5")
|
35 |
|