LiuPengNGP commited on
Commit
051ed2a
ยท
1 Parent(s): 6e99a1c
Files changed (1) hide show
  1. app.py +52 -32
app.py CHANGED
@@ -46,10 +46,10 @@ with gr.Blocks(css="app.css") as demo:
46
  value="Submit", interactive=True, scale=1, elem_classes="submit"
47
  )
48
  with gr.Column(scale=2, elem_classes="dl4"):
49
- with gr.Row():
50
- output_video = gr.Video(scale=1, elem_classes="video2")
51
- output_face = gr.Video(scale=1, elem_classes="video3")
52
- output_heatmaps = gr.Video( scale=1, elem_classes="video4")
53
  output_statistics = gr.Plot(label="ๆƒ…ๆ„Ÿๆ•ฐๆฎ", elem_classes="stat")
54
  gr.Examples(
55
  ["videos/video1.mp4",
@@ -58,6 +58,53 @@ with gr.Blocks(css="app.css") as demo:
58
  [input_video],
59
  )
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  # with gr.Tab("Static App"):
62
  # gr.Markdown(value=DESCRIPTION_STATIC)
63
  # with gr.Row():
@@ -100,31 +147,4 @@ with gr.Blocks(css="app.css") as demo:
100
  # inputs=[],
101
  # outputs=[input_image, output_image, output_heatmap, output_label],
102
  # queue=True,
103
- #)
104
-
105
- submit_dynamic.click(
106
- fn=preprocess_video_and_predict,
107
- inputs=input_video,
108
- outputs=[
109
- output_video,
110
- output_face,
111
- output_heatmaps,
112
- output_statistics
113
- ],
114
- queue=True,
115
- )
116
- clear_btn_dynamic.click(
117
- fn=clear_dynamic_info,
118
- inputs=[],
119
- outputs=[
120
- input_video,
121
- output_video,
122
- output_face,
123
- output_heatmaps,
124
- output_statistics
125
- ],
126
- queue=True,
127
- )
128
-
129
- if __name__ == "__main__":
130
- demo.queue(api_open=False).launch(share=False)
 
46
  value="Submit", interactive=True, scale=1, elem_classes="submit"
47
  )
48
  with gr.Column(scale=2, elem_classes="dl4"):
49
+ # with gr.Row():
50
+ # output_video = gr.Video(label="Original video", scale=1, elem_classes="video2")
51
+ # output_face = gr.Video(label="Pre-processed video", scale=1, elem_classes="video3")
52
+ # output_heatmaps = gr.Video(label="Heatmaps", scale=1, elem_classes="video4")
53
  output_statistics = gr.Plot(label="ๆƒ…ๆ„Ÿๆ•ฐๆฎ", elem_classes="stat")
54
  gr.Examples(
55
  ["videos/video1.mp4",
 
58
  [input_video],
59
  )
60
 
61
+
62
+
63
+ submit_dynamic.click(
64
+ fn=preprocess_video_and_predict,
65
+ inputs=input_video,
66
+ outputs=[
67
+ #output_video,
68
+ #output_face,
69
+ # output_heatmaps,
70
+ output_statistics
71
+ ],
72
+ queue=True,
73
+ )
74
+ clear_btn_dynamic.click(
75
+ fn=clear_dynamic_info,
76
+ inputs=[],
77
+ outputs=[
78
+ input_video,
79
+ # output_video,
80
+ # output_face,
81
+ # output_heatmaps,
82
+ output_statistics
83
+ ],
84
+ queue=True,
85
+ )
86
+
87
+ if __name__ == "__main__":
88
+ demo.queue(api_open=False).launch(share=False)
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
  # with gr.Tab("Static App"):
109
  # gr.Markdown(value=DESCRIPTION_STATIC)
110
  # with gr.Row():
 
147
  # inputs=[],
148
  # outputs=[input_image, output_image, output_heatmap, output_label],
149
  # queue=True,
150
+ #)