Spaces:
Runtime error
Runtime error
Aadhithya
commited on
Commit
·
5ce3e66
1
Parent(s):
77a79c3
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ from roop.utilities import normalize_output_path
|
|
12 |
import os
|
13 |
from PIL import Image
|
14 |
|
|
|
15 |
def swap_face(source_file, target_file):
|
16 |
|
17 |
source_path = "input.jpg"
|
@@ -22,7 +23,7 @@ def swap_face(source_file, target_file):
|
|
22 |
target_image = Image.fromarray(target_file)
|
23 |
target_image.save(target_path)
|
24 |
|
25 |
-
print("source_path: ", source_path)
|
26 |
print("target_path: ", target_path)
|
27 |
|
28 |
roop.globals.source_path = source_path
|
@@ -44,20 +45,23 @@ print("source_path: ", source_path)
|
|
44 |
roop.globals.execution_threads = suggest_execution_threads()
|
45 |
|
46 |
print(
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
)
|
|
|
52 |
for frame_processor in get_frame_processors_modules(
|
53 |
roop.globals.frame_processors
|
54 |
):
|
55 |
if not frame_processor.pre_check():
|
56 |
return
|
|
|
57 |
start()
|
58 |
-
return output_path
|
|
|
59 |
|
60 |
app = gr.Interface(
|
61 |
fn=swap_face, inputs=[gr.Image(), gr.Image()], outputs="image"
|
62 |
)
|
63 |
-
app.launch()
|
|
|
12 |
import os
|
13 |
from PIL import Image
|
14 |
|
15 |
+
|
16 |
def swap_face(source_file, target_file):
|
17 |
|
18 |
source_path = "input.jpg"
|
|
|
23 |
target_image = Image.fromarray(target_file)
|
24 |
target_image.save(target_path)
|
25 |
|
26 |
+
print("source_path: ", source_path)
|
27 |
print("target_path: ", target_path)
|
28 |
|
29 |
roop.globals.source_path = source_path
|
|
|
45 |
roop.globals.execution_threads = suggest_execution_threads()
|
46 |
|
47 |
print(
|
48 |
+
"start process",
|
49 |
+
roop.globals.source_path,
|
50 |
+
roop.globals.target_path,
|
51 |
+
roop.globals.output_path,
|
52 |
)
|
53 |
+
|
54 |
for frame_processor in get_frame_processors_modules(
|
55 |
roop.globals.frame_processors
|
56 |
):
|
57 |
if not frame_processor.pre_check():
|
58 |
return
|
59 |
+
|
60 |
start()
|
61 |
+
return output_path
|
62 |
+
|
63 |
|
64 |
app = gr.Interface(
|
65 |
fn=swap_face, inputs=[gr.Image(), gr.Image()], outputs="image"
|
66 |
)
|
67 |
+
app.launch()
|