CelagenexResearch commited on
Commit
f51b769
·
verified ·
1 Parent(s): 897b2d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -478,9 +478,12 @@ def get_healthspan_grade(score):
478
  else:
479
  return "Critical (F)"
480
 
481
- def comprehensive_healthspan_analysis(image, video, breed, age, *hrqol_responses):
482
  """Combine video analysis with HRQOL assessment"""
483
 
 
 
 
484
  if image is None and video is None:
485
  return "❌ **Error**: Please provide either an image or video for analysis."
486
 
@@ -669,7 +672,7 @@ with gr.Blocks(title="🐶 VetMetrica HRQOL Dog Health Analyzer", theme=gr.theme
669
  video_input = gr.Video(label="Upload Video (10-30 seconds)")
670
 
671
  with gr.Tab("📹 Live Record"):
672
- video_record = gr.Video(source="webcam", label="Record Live Video")
673
 
674
  gr.Markdown("### ⚙️ **Optional Information**")
675
  breed_input = gr.Dropdown(
@@ -717,13 +720,8 @@ with gr.Blocks(title="🐶 VetMetrica HRQOL Dog Health Analyzer", theme=gr.theme
717
  output_report = gr.HTML()
718
 
719
  # Connect analysis function
720
- def process_analysis(image, video_upload, video_record, breed, age, *responses):
721
- # Use video_record if available, otherwise use video_upload
722
- video = video_record if video_record else video_upload
723
- return comprehensive_healthspan_analysis(image, video, breed, age, *responses)
724
-
725
  analyze_button.click(
726
- fn=process_analysis,
727
  inputs=[image_input, video_input, video_record, breed_input, age_input] + hrqol_inputs,
728
  outputs=output_report
729
  )
 
478
  else:
479
  return "Critical (F)"
480
 
481
+ def comprehensive_healthspan_analysis(image, video_upload, video_record, breed, age, *hrqol_responses):
482
  """Combine video analysis with HRQOL assessment"""
483
 
484
+ # Use video_record if available, otherwise use video_upload
485
+ video = video_record if video_record else video_upload
486
+
487
  if image is None and video is None:
488
  return "❌ **Error**: Please provide either an image or video for analysis."
489
 
 
672
  video_input = gr.Video(label="Upload Video (10-30 seconds)")
673
 
674
  with gr.Tab("📹 Live Record"):
675
+ video_record = gr.Video(label="Record Live Video") # Fixed: Removed source="webcam"
676
 
677
  gr.Markdown("### ⚙️ **Optional Information**")
678
  breed_input = gr.Dropdown(
 
720
  output_report = gr.HTML()
721
 
722
  # Connect analysis function
 
 
 
 
 
723
  analyze_button.click(
724
+ fn=comprehensive_healthspan_analysis,
725
  inputs=[image_input, video_input, video_record, breed_input, age_input] + hrqol_inputs,
726
  outputs=output_report
727
  )