SuriRaja commited on
Commit
ba85c99
Β·
verified Β·
1 Parent(s): 2055322

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -190,12 +190,14 @@ with gr.Blocks() as demo:
190
  """)
191
  with gr.Row():
192
  with gr.Column():
193
- video_input = gr.Video(label="πŸ“½ Upload Face Video", sources=["upload", "webcam"])
194
- submit_btn = gr.Button("πŸ” Analyze")
 
195
  with gr.Column():
196
  result_html = gr.HTML(label="πŸ§ͺ Health Report Table")
197
  result_image = gr.Image(label="πŸ“· Key Frame Snapshot")
198
- submit_btn.click(fn=analyze_face, inputs=video_input, outputs=[result_html, result_image])
 
199
  gr.Markdown("""---
200
  βœ… Table Format β€’ AI Prediction β€’ rPPG-based HR β€’ Dynamic Summary β€’ Multilingual Support β€’ CTA""")
201
 
 
190
  """)
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
+ mode_selector = gr.Radio(label="Choose Input Mode", choices=["Image", "Video"], value="Image")
200
+ submit_btn.click(fn=lambda mode, video, image: analyze_video(video) if mode=="Video" else analyze_face(image), inputs=[mode_selector, video_input, video_input], outputs=[result_html, result_image])
201
  gr.Markdown("""---
202
  βœ… Table Format β€’ AI Prediction β€’ rPPG-based HR β€’ Dynamic Summary β€’ Multilingual Support β€’ CTA""")
203