SuriRaja commited on
Commit
10c366b
Β·
verified Β·
1 Parent(s): 2b8c70c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- video_input = gr.Video(label="πŸ“½ Upload Face Video or Image", sources=["upload", "webcam"])
 
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
- submit_btn.click(fn=lambda mode, file: analyze_video(file) if mode=="Video" else analyze_face(file), inputs=[mode_selector, video_input], outputs=[result_html, result_image])
 
 
 
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""")