Commit ยท
0d028f8
1
Parent(s): 4b32c49
111
Browse files- app.py +54 -55
- result_face.mp4 +0 -0
- result_hm.mp4 +0 -0
- videos/{videos_video1.mp4 โ video1.mp4} +0 -0
- videos/{videos_video2.mp4 โ video2.mp4} +0 -0
app.py
CHANGED
|
@@ -33,7 +33,7 @@ def clear_dynamic_info():
|
|
| 33 |
)
|
| 34 |
|
| 35 |
with gr.Blocks(css="app.css") as demo:
|
| 36 |
-
with gr.Tab("
|
| 37 |
gr.Markdown(value=DESCRIPTION_DYNAMIC)
|
| 38 |
with gr.Row():
|
| 39 |
with gr.Column(scale=2):
|
|
@@ -46,11 +46,11 @@ 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 |
-
|
| 50 |
-
|
| 51 |
-
output_face = gr.Video(label="Pre-processed video", scale=1, elem_classes="video3")
|
| 52 |
-
|
| 53 |
-
output_statistics = gr.Plot(label="
|
| 54 |
gr.Examples(
|
| 55 |
["videos/video1.mp4",
|
| 56 |
"videos/video2.mp4",
|
|
@@ -58,58 +58,57 @@ with gr.Blocks(css="app.css") as demo:
|
|
| 58 |
[input_video],
|
| 59 |
)
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
gr.Markdown(value=AUTHORS)
|
| 92 |
|
| 93 |
-
submit.click(
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
clear_btn.click(
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
)
|
| 105 |
|
| 106 |
submit_dynamic.click(
|
| 107 |
fn=preprocess_video_and_predict,
|
| 108 |
inputs=input_video,
|
| 109 |
outputs=[
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
output_statistics
|
| 114 |
],
|
| 115 |
queue=True,
|
|
@@ -119,9 +118,9 @@ with gr.Blocks(css="app.css") as demo:
|
|
| 119 |
inputs=[],
|
| 120 |
outputs=[
|
| 121 |
input_video,
|
| 122 |
-
output_video,
|
| 123 |
-
|
| 124 |
-
|
| 125 |
output_statistics
|
| 126 |
],
|
| 127 |
queue=True,
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
with gr.Blocks(css="app.css") as demo:
|
| 36 |
+
with gr.Tab("่ง้ขไธ้ข้จๅๆ"):
|
| 37 |
gr.Markdown(value=DESCRIPTION_DYNAMIC)
|
| 38 |
with gr.Row():
|
| 39 |
with gr.Column(scale=2):
|
|
|
|
| 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",
|
| 56 |
"videos/video2.mp4",
|
|
|
|
| 58 |
[input_video],
|
| 59 |
)
|
| 60 |
|
| 61 |
+
# with gr.Tab("Static App"):
|
| 62 |
+
# gr.Markdown(value=DESCRIPTION_STATIC)
|
| 63 |
+
# with gr.Row():
|
| 64 |
+
# with gr.Column(scale=2, elem_classes="dl1"):
|
| 65 |
+
# input_image = gr.Image(label="Original image", type="pil")
|
| 66 |
+
# with gr.Row():
|
| 67 |
+
# clear_btn = gr.Button(
|
| 68 |
+
# value="Clear", interactive=True, scale=1, elem_classes="clear"
|
| 69 |
+
# )
|
| 70 |
+
## value="Submit", interactive=True, scale=1, elem_classes="submit"
|
| 71 |
+
# )
|
| 72 |
+
#with gr.Column(scale=1, elem_classes="dl4"):
|
| 73 |
+
# with gr.Row():
|
| 74 |
+
# output_image = gr.Image(label="Face", scale=1, elem_classes="dl5")
|
| 75 |
+
# output_heatmap = gr.Image(label="Heatmap", scale=1, elem_classes="dl2")
|
| 76 |
+
# output_label = gr.Label(num_top_classes=3, scale=1, elem_classes="dl3")
|
| 77 |
+
# gr.Examples(
|
| 78 |
+
# [
|
| 79 |
+
# "images/fig7.jpg",
|
| 80 |
+
# "images/fig1.jpg",
|
| 81 |
+
# "images/fig2.jpg",
|
| 82 |
+
# "images/fig3.jpg",
|
| 83 |
+
# "images/fig4.jpg",
|
| 84 |
+
# "images/fig5.jpg",
|
| 85 |
+
# "images/fig6.jpg",
|
| 86 |
+
# ],
|
| 87 |
+
# [input_image],
|
| 88 |
+
# )
|
| 89 |
+
#with gr.Tab("Authors"):
|
| 90 |
+
# gr.Markdown(value=AUTHORS)
|
|
|
|
| 91 |
|
| 92 |
+
#submit.click(
|
| 93 |
+
# fn=preprocess_image_and_predict,
|
| 94 |
+
# inputs=[input_image],
|
| 95 |
+
# outputs=[output_image, output_heatmap, output_label],
|
| 96 |
+
# queue=True,
|
| 97 |
+
# )
|
| 98 |
+
#clear_btn.click(
|
| 99 |
+
# fn=clear_static_info,
|
| 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,
|
|
|
|
| 118 |
inputs=[],
|
| 119 |
outputs=[
|
| 120 |
input_video,
|
| 121 |
+
# output_video,
|
| 122 |
+
# output_face,
|
| 123 |
+
# output_heatmaps,
|
| 124 |
output_statistics
|
| 125 |
],
|
| 126 |
queue=True,
|
result_face.mp4
CHANGED
|
Binary files a/result_face.mp4 and b/result_face.mp4 differ
|
|
|
result_hm.mp4
CHANGED
|
Binary files a/result_hm.mp4 and b/result_hm.mp4 differ
|
|
|
videos/{videos_video1.mp4 โ video1.mp4}
RENAMED
|
File without changes
|
videos/{videos_video2.mp4 โ video2.mp4}
RENAMED
|
File without changes
|