File size: 1,842 Bytes
1678478
81ae7f5
1678478
2da4d12
 
 
81ae7f5
1678478
51e8e8a
1678478
 
 
81ae7f5
 
 
 
1678478
 
 
 
 
 
 
 
81ae7f5
 
 
 
 
 
 
 
 
 
 
 
1678478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import gradio as gr
import subprocess

import spaces

@spaces.GPU
def greet(name):

    cmd = ["cat", "/etc/os-release"]
    result = subprocess.run(cmd, capture_output=True)
    print(result.stdout.decode("utf-8"))

    cmd = ["python", "-V"]
    result = subprocess.run(cmd, capture_output=True)
    print(result.stdout.decode("utf-8"))

    cmd = ["pip", "list"]
    result = subprocess.run(cmd, capture_output=True)
    print(result.stdout.decode("utf-8"))

    cmd = ["nvcc", "-V"]
    result = subprocess.run(cmd, capture_output=True)
    print(result.stdout.decode("utf-8"))

    return "Hello " + name + "!!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()

def fix_face_video(input_image, input_audio):

    # 調査用
    




    

    dt = datetime.datetime.now() + datetime.timedelta(hours=9)
    fol_name = dt.strftime("%Y%m%d")
    file_name = dt.strftime("%H%M%S")

    out_video = "./output/" + fol_name+ "/fix_face_" + file_name + ".mp4"

    inference.fix_face(input_image, input_audio, out_video)

    return out_video

image = gr.Image(label="画像(image)", type="filepath")
audio = gr.File(label="音声(audio)", file_types=[".mp3", ".MP3"])
out_video = gr.Video(label="Fix Face Video")
btn = gr.Button("送信", variant="primary")

title = "V_Express"
description = "<div style='text-align: center;'><h3>画像と音声だけで生成できます。(Using only images and audio)"
description += "<br>This uses the following V-Express \"https://github.com/tencent-ailab/V-Express\"</h3></div>"

demo = gr.Interface(
    fn=fix_face_video,
    inputs=[image, audio],
    examples=[example1, example2],
    outputs=[out_video],
    title=title,
    submit_btn=btn,
    clear_btn=None,
    description=description,
    allow_flagging="never"
)

demo.queue()
demo.launch(share=True, debug=True)