Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,10 @@ from io import BytesIO
|
|
6 |
|
7 |
# Function to run the provided script and return the path of the generated video
|
8 |
def run_script(image_path, video_path):
|
9 |
-
output_video_path = "/content/swapped.mp4"
|
10 |
script = """
|
|
|
|
|
11 |
!git clone https://github.com/s0md3v/roop.git
|
12 |
%cd roop
|
13 |
|
@@ -18,8 +20,8 @@ def run_script(image_path, video_path):
|
|
18 |
!python run.py --target {} --output-video-quality 80 --source {} -o {} --execution-provider cuda --frame-processor face_swapper face_enhancer
|
19 |
""".format(video_path, image_path, output_video_path)
|
20 |
|
21 |
-
subprocess.run(script, shell=True)
|
22 |
-
|
23 |
# Return the path of the generated video
|
24 |
return output_video_path
|
25 |
|
|
|
6 |
|
7 |
# Function to run the provided script and return the path of the generated video
|
8 |
def run_script(image_path, video_path):
|
9 |
+
output_video_path = "/content/roop/swapped.mp4"
|
10 |
script = """
|
11 |
+
cd /content/roop
|
12 |
+
|
13 |
!git clone https://github.com/s0md3v/roop.git
|
14 |
%cd roop
|
15 |
|
|
|
20 |
!python run.py --target {} --output-video-quality 80 --source {} -o {} --execution-provider cuda --frame-processor face_swapper face_enhancer
|
21 |
""".format(video_path, image_path, output_video_path)
|
22 |
|
23 |
+
subprocess.run(script, shell=True, cwd="/content")
|
24 |
+
|
25 |
# Return the path of the generated video
|
26 |
return output_video_path
|
27 |
|