Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
import shutil
|
| 3 |
import subprocess
|
| 4 |
import logging
|
|
@@ -145,3 +145,29 @@ description = "An interactive interface for generating talking face videos using
|
|
| 145 |
#demo = gr.Interface(run_demo, inputs, output, title=title, description=description)
|
| 146 |
demo = gr.Interface(profile_run_demo, inputs, output, title=title, description=description)
|
| 147 |
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""import gradio as gr
|
| 2 |
import shutil
|
| 3 |
import subprocess
|
| 4 |
import logging
|
|
|
|
| 145 |
#demo = gr.Interface(run_demo, inputs, output, title=title, description=description)
|
| 146 |
demo = gr.Interface(profile_run_demo, inputs, output, title=title, description=description)
|
| 147 |
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|
| 148 |
+
"""
|
| 149 |
+
|
| 150 |
+
import subprocess
|
| 151 |
+
import os
|
| 152 |
+
|
| 153 |
+
def setup_and_run():
|
| 154 |
+
try:
|
| 155 |
+
# Run the setup script
|
| 156 |
+
subprocess.run(['bash', 'setup.sh'], check=True)
|
| 157 |
+
|
| 158 |
+
# Change the working directory to V-Express
|
| 159 |
+
os.chdir('V-Express')
|
| 160 |
+
|
| 161 |
+
# Run the extract_kps_sequence_and_audio.py script from within the V-Express directory
|
| 162 |
+
result = subprocess.run(['python', 'extract_kps_sequence_and_audio.py'], capture_output=True, text=True)
|
| 163 |
+
|
| 164 |
+
# Change back to the original working directory
|
| 165 |
+
os.chdir('..')
|
| 166 |
+
|
| 167 |
+
return result.stdout + "\n" + result.stderr
|
| 168 |
+
except subprocess.CalledProcessError as e:
|
| 169 |
+
return f"An error occurred: {e}\n{e.output}"
|
| 170 |
+
|
| 171 |
+
if __name__ == "__main__":
|
| 172 |
+
output = setup_and_run()
|
| 173 |
+
print(output)
|