Sapphire-356 commited on
Commit
e157aaa
·
1 Parent(s): b56c42a

update the UI

Browse files
Files changed (2) hide show
  1. app.py +31 -7
  2. input_videos/kun_test_5sec.mp4 +0 -0
app.py CHANGED
@@ -2,6 +2,9 @@ import gradio as gr
2
  from videopose_PSTMO import gr_video2mc
3
  import os
4
 
 
 
 
5
 
6
  def Video2MC(video, progress=gr.Progress(track_tqdm=True)):
7
 
@@ -10,13 +13,34 @@ def Video2MC(video, progress=gr.Progress(track_tqdm=True)):
10
 
11
  return output_path, output_path, output_video
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- iface = gr.Interface(fn=Video2MC,
15
- inputs=gr.Video(),
16
- outputs=["file", "text", gr.Video()],
17
- examples=[os.path.join(os.path.dirname(__file__),
18
- "input_videos/kun_test_5sec.mp4")],
19
- cache_examples=False,
20
- )
21
 
22
  iface.queue(concurrency_count=10).launch()
 
2
  from videopose_PSTMO import gr_video2mc
3
  import os
4
 
5
+ # ffmpeg -i input_videos/kun_1280x720_30fps_0-14_0-32.mp4 -vf trim=0:5,setpts=PTS-STARTPTS input_videos/kun_test_5sec.mp4
6
+ # ffmpeg -i input.mp4 -vf scale=320:-1 output.mp4
7
+
8
 
9
  def Video2MC(video, progress=gr.Progress(track_tqdm=True)):
10
 
 
13
 
14
  return output_path, output_path, output_video
15
 
16
+ with gr.Blocks() as iface:
17
+
18
+ text1 = gr.Markdown(
19
+ """
20
+ <div align=center>
21
+ <img src="https://github.com/Balloon-356/Video2MC/assets/114230565/2622c7b7-7b5d-458c-bd9a-dc0be37af370" />
22
+ """
23
+ # </div>
24
+ # <h1 align="center">Video2MC: 基于3D人体姿态估计的MC动画自动生成</h1>
25
+ )
26
+
27
+ with gr.Row():
28
+
29
+ with gr.Column():
30
+ input_video = gr.Video()
31
+ with gr.Row():
32
+ btn_c = gr.ClearButton(input_video)
33
+ btn_s = gr.Button("Submit", variant='primary')
34
+ gr.Examples([os.path.join(os.path.dirname(__file__),
35
+ "input_videos/kun_test_5sec.mp4")], input_video)
36
+
37
+ with gr.Column():
38
+ output_miframes = gr.File()
39
+ output_path = gr.Text()
40
+ output_video = gr.Video()
41
+
42
+
43
+ btn_s.click(Video2MC, inputs=[input_video], outputs=[output_miframes, output_path, output_video])
44
 
 
 
 
 
 
 
 
45
 
46
  iface.queue(concurrency_count=10).launch()
input_videos/kun_test_5sec.mp4 CHANGED
Binary files a/input_videos/kun_test_5sec.mp4 and b/input_videos/kun_test_5sec.mp4 differ