Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 37 |
-
print(
|
| 38 |
-
print("STDERR
|
|
|
|
| 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("โ
|
| 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 |
|