navonapp commited on
Commit
5aa8d2e
ยท
verified ยท
1 Parent(s): 69c7466

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -26,23 +26,22 @@ def swap_faces(source_file, target_file, mode):
26
  "--target-path", tmp_target,
27
  "--output-path", output_path,
28
  "--processors", "face_swapper",
29
- "--face-detector-model", "retinaface",
30
- "--face-selector-mode", "one",
31
  "--log-level", "debug"
32
  ]
33
 
34
  result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
35
 
36
- # โœ… ื”ื“ืคืกืช DEBUG ืžืœืื”
37
- print("STDOUT:\n", result.stdout.decode())
38
- print("STDERR:\n", result.stderr.decode())
 
39
 
40
  if result.returncode != 0:
41
  raise Exception(f"Processing failed:\n{result.stderr.decode()}")
42
 
43
- # โœ… ื ื‘ื“ื•ืง ืื ื‘ืืžืช ื ื•ืฆืจ ื”ืงื•ื‘ืฅ
44
  if not os.path.exists(output_path):
45
- raise Exception("โŒ Processing finished but no output file was generated.")
46
 
47
  return output_path
48
 
 
26
  "--target-path", tmp_target,
27
  "--output-path", output_path,
28
  "--processors", "face_swapper",
 
 
29
  "--log-level", "debug"
30
  ]
31
 
32
  result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
33
 
34
+ print("=== STDOUT ===")
35
+ print(result.stdout.decode())
36
+ print("=== STDERR ===")
37
+ print(result.stderr.decode())
38
 
39
  if result.returncode != 0:
40
  raise Exception(f"Processing failed:\n{result.stderr.decode()}")
41
 
42
+ # โœ… ื‘ื“ื™ืงื” ืื ื”ืงื•ื‘ืฅ ื ื•ืฆืจ ื‘ืืžืช
43
  if not os.path.exists(output_path):
44
+ raise Exception("โŒ ื”ืงื•ื‘ืฅ ืœื ื ื•ืฆืจ โ€“ ื›ื ืจืื” ืฉื”ืชื”ืœื™ืš ื ื›ืฉืœ ืคื ื™ืžื™ืช ื‘ืœื™ ืœื”ื—ื–ื™ืจ ืฉื’ื™ืื”.")
45
 
46
  return output_path
47