Update app.py
Browse files
app.py
CHANGED
@@ -191,13 +191,17 @@ with gr.Blocks() as demo:
|
|
191 |
with gr.Row():
|
192 |
with gr.Column():
|
193 |
mode_selector = gr.Radio(label="Choose Input Mode", choices=["Image", "Video"], value="Image")
|
194 |
-
|
|
|
195 |
submit_btn = gr.Button("π Analyze")
|
196 |
with gr.Column():
|
197 |
result_html = gr.HTML(label="π§ͺ Health Report Table")
|
198 |
result_image = gr.Image(label="π· Key Frame Snapshot")
|
199 |
|
200 |
-
|
|
|
|
|
|
|
201 |
|
202 |
gr.Markdown("""---
|
203 |
β
Table Format β’ AI Prediction β’ rPPG-based HR β’ Dynamic Summary β’ Multilingual Support β’ CTA""")
|
|
|
191 |
with gr.Row():
|
192 |
with gr.Column():
|
193 |
mode_selector = gr.Radio(label="Choose Input Mode", choices=["Image", "Video"], value="Image")
|
194 |
+
image_input = gr.Image(type="numpy", label="πΈ Upload Face Image")
|
195 |
+
video_input = gr.Video(label="π½ Upload Face Video", sources=["upload", "webcam"])
|
196 |
submit_btn = gr.Button("π Analyze")
|
197 |
with gr.Column():
|
198 |
result_html = gr.HTML(label="π§ͺ Health Report Table")
|
199 |
result_image = gr.Image(label="π· Key Frame Snapshot")
|
200 |
|
201 |
+
def route_inputs(mode, image, video):
|
202 |
+
return analyze_video(video) if mode == "Video" else analyze_face(image)
|
203 |
+
|
204 |
+
submit_btn.click(fn=route_inputs, inputs=[mode_selector, image_input, video_input], outputs=[result_html, result_image])
|
205 |
|
206 |
gr.Markdown("""---
|
207 |
β
Table Format β’ AI Prediction β’ rPPG-based HR β’ Dynamic Summary β’ Multilingual Support β’ CTA""")
|