felixrosberg commited on
Commit
1b7cc25
β€’
1 Parent(s): 2db9258

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -12,12 +12,14 @@ from tensorflow.keras.models import load_model
12
  from retinaface.models import *
13
  from options.swap_options import SwapOptions
14
 
 
 
15
 
16
  opt = SwapOptions().parse()
17
 
18
 
19
  retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50",
20
- private=True, use_auth_token="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", git_user="felixrosberg")
21
  RetinaFace = load_model("retina_model/retinaface_res50.h5",
22
  custom_objects={"FPN": FPN,
23
  "SSH": SSH,
@@ -26,11 +28,11 @@ RetinaFace = load_model("retina_model/retinaface_res50.h5",
26
  "ClassHead": ClassHead})
27
 
28
  arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcface_tf",
29
- 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",
33
- private=True, use_auth_token="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")
34
  G = load_model("g_model/affa_f_demo.h5", custom_objects={"AdaIN": AdaIN,
35
  "AdaptiveAttention": AdaptiveAttention,
36
  "InstanceNormalization": InstanceNormalization})
@@ -102,7 +104,7 @@ def run_inference(target, source):
102
  return total_img
103
 
104
  description = "Performs subject agnostic identity transfer from a source face to all target faces."
105
- examples = [["elon_musk_example.jpg"], ["rick_astely_example.jpg"], ["10017.png"], ["9538.png"]]
106
  article="""
107
  Demo is based of recent research from my Ph.D work. Results expects to be published in the coming months.
108
  """
 
12
  from retinaface.models import *
13
  from options.swap_options import SwapOptions
14
 
15
+ # Invalidated!
16
+ token = "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"
17
 
18
  opt = SwapOptions().parse()
19
 
20
 
21
  retina_repo = Repository(local_dir="retina_model", clone_from="felixrosberg/retinaface_resnet50",
22
+ private=True, use_auth_token=token, git_user="felixrosberg")
23
  RetinaFace = load_model("retina_model/retinaface_res50.h5",
24
  custom_objects={"FPN": FPN,
25
  "SSH": SSH,
 
28
  "ClassHead": ClassHead})
29
 
30
  arc_repo = Repository(local_dir="arcface_model", clone_from="felixrosberg/arcface_tf",
31
+ private=True, use_auth_token=token)
32
  ArcFace = load_model("arcface_model/arc_res50.h5")
33
 
34
  g_repo = Repository(local_dir="g_model", clone_from="felixrosberg/affa_f",
35
+ private=True, use_auth_token=token)
36
  G = load_model("g_model/affa_f_demo.h5", custom_objects={"AdaIN": AdaIN,
37
  "AdaptiveAttention": AdaptiveAttention,
38
  "InstanceNormalization": InstanceNormalization})
 
104
  return total_img
105
 
106
  description = "Performs subject agnostic identity transfer from a source face to all target faces."
107
+ examples = [["elon_musk_example.jpg", "rick_astely_example.jpg"], ["10017.png", "9538.png"]]
108
  article="""
109
  Demo is based of recent research from my Ph.D work. Results expects to be published in the coming months.
110
  """