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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -17,7 +17,7 @@ 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 +26,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})
@@ -101,9 +101,18 @@ def run_inference(target, source):
101
 
102
  return total_img
103
 
 
 
 
 
 
104
 
105
  iface = gradio.Interface(run_inference,
106
  [gradio.inputs.Image(shape=None),
107
  gradio.inputs.Image(shape=None)],
108
- gradio.outputs.Image())
 
 
 
 
109
  iface.launch()
 
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
  "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})
 
101
 
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
+ """
109
 
110
  iface = gradio.Interface(run_inference,
111
  [gradio.inputs.Image(shape=None),
112
  gradio.inputs.Image(shape=None)],
113
+ gradio.outputs.Image(),
114
+ title="Face Swap",
115
+ description=description,
116
+ examples=examples,
117
+ article=article)
118
  iface.launch()