Spaces:
Sleeping
Sleeping
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""")
|