Spaces:
Runtime error
Runtime error
call inference_gfpgan cmd
Browse files- colab_flask.py +9 -5
colab_flask.py
CHANGED
@@ -122,21 +122,25 @@ def call_gfpgan(wav2lip_mp4, audio_path, output_mp4):
|
|
122 |
# -s 2
|
123 |
# --only_center_face
|
124 |
# --bg_upsampler None
|
|
|
125 |
cmd = [
|
126 |
"python",
|
127 |
"gfpgan/inference_gfpgan.py",
|
128 |
"-i", origin_frames_folder,
|
129 |
"-o", folder_path,
|
130 |
-
"-v", 1.
|
131 |
-
"-s", 2,
|
132 |
"--only_center_face",
|
133 |
-
"--bg_upsampler",
|
134 |
]
|
135 |
-
|
|
|
|
|
|
|
|
|
136 |
|
137 |
restoredFramesPath = os.path.join(folder_path, 'restored_imgs')
|
138 |
os.makedirs(restoredFramesPath, exist_ok=True)
|
139 |
-
folder_path = folder_path
|
140 |
dir_list = os.listdir(restoredFramesPath)
|
141 |
dir_list.sort()
|
142 |
batch = 0
|
|
|
122 |
# -s 2
|
123 |
# --only_center_face
|
124 |
# --bg_upsampler None
|
125 |
+
start = datetime.now()
|
126 |
cmd = [
|
127 |
"python",
|
128 |
"gfpgan/inference_gfpgan.py",
|
129 |
"-i", origin_frames_folder,
|
130 |
"-o", folder_path,
|
131 |
+
"-v", str(1.4),
|
132 |
+
"-s", str(2),
|
133 |
"--only_center_face",
|
134 |
+
"--bg_upsampler", 'realesrgan'
|
135 |
]
|
136 |
+
print(cmd)
|
137 |
+
proc = subprocess.Popen(cmd, shell=False)
|
138 |
+
proc.communicate()
|
139 |
+
duration = datetime.now() - start
|
140 |
+
print(f'inference_gfpgan finished in {duration}')
|
141 |
|
142 |
restoredFramesPath = os.path.join(folder_path, 'restored_imgs')
|
143 |
os.makedirs(restoredFramesPath, exist_ok=True)
|
|
|
144 |
dir_list = os.listdir(restoredFramesPath)
|
145 |
dir_list.sort()
|
146 |
batch = 0
|