fffiloni commited on
Commit
af03bb5
·
verified ·
1 Parent(s): 1f4d91a

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -50
app.py DELETED
@@ -1,50 +0,0 @@
1
- import gradio as gr
2
- import os
3
- import subprocess
4
- import tempfile
5
- from glob import glob
6
-
7
- def run_inference(image_input, audio_input):
8
-
9
- # Create a temporary folder for downloaded and processed images
10
- temp_dir = tempfile.mkdtemp()
11
-
12
- try:
13
- # Run the inference command
14
- subprocess.run(
15
- [
16
- "python", "inference.py",
17
- "--config", "configs/inference.yaml",
18
- "--input_image", image_input,
19
- "--input_audio", audio_input,
20
- "--output_dir", temp_dir,
21
- ],
22
- check=True
23
- )
24
-
25
- # Collect the output images
26
- output_video = glob(os.path.join(temp_dir, "*.mp4"))
27
- return output_video[0]
28
- except subprocess.CalledProcessError as e:
29
- raise gr.Error(f"Error during inference: {str(e)}")
30
-
31
-
32
-
33
- with gr.Blocks() as demo:
34
- with gr.Column():
35
- gr.Markdown("# MEMO")
36
- with gr.Row():
37
- with gr.Column():
38
- image_input = gr.Image(label="Image Input", type="filepath")
39
- audio_input = gr.Audio(label="Audio Input", type="filepath")
40
- submit_btn = gr.Button("Submit")
41
- with gr.Column():
42
- output_result = gr.Video(label="Result")
43
-
44
- submit_btn.click(
45
- fn =run_inference,
46
- inputs =[image_input, audio_input],
47
- outputs = [output_result]
48
- )
49
-
50
- demo.queue().launch()