tuan2308 commited on
Commit
438e3e2
1 Parent(s): decc5b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -37,6 +37,7 @@ def swap_face(source_file, target_file, doFaceEnhancer):
37
  roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
38
  else:
39
  roop.globals.frame_processors = ["face_swapper"]
 
40
  roop.globals.headless = True
41
  roop.globals.keep_fps = True
42
  roop.globals.keep_audio = True
@@ -67,12 +68,19 @@ def swap_face(source_file, target_file, doFaceEnhancer):
67
  roop.globals.frame_processors
68
  ):
69
  if not frame_processor.pre_check():
 
70
  return
71
 
72
  start()
73
  return output_path
74
 
75
  app = gr.Interface(
76
- fn=swap_face, inputs=[gr.Image(), gr.Image(), gr.Checkbox(label="face_enhancer?", info="do face enhancer?")], outputs="image"
 
 
 
 
 
 
77
  )
78
  app.launch()
 
37
  roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
38
  else:
39
  roop.globals.frame_processors = ["face_swapper"]
40
+
41
  roop.globals.headless = True
42
  roop.globals.keep_fps = True
43
  roop.globals.keep_audio = True
 
68
  roop.globals.frame_processors
69
  ):
70
  if not frame_processor.pre_check():
71
+ print(f"Pre-check failed for {frame_processor}")
72
  return
73
 
74
  start()
75
  return output_path
76
 
77
  app = gr.Interface(
78
+ fn=swap_face,
79
+ inputs=[
80
+ gr.Image(),
81
+ gr.Image(),
82
+ gr.Checkbox(label="Face Enhancer?", info="Do face enhancement?")
83
+ ],
84
+ outputs="image"
85
  )
86
  app.launch()