Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ BREED_LIFESPAN = {
|
|
115 |
"wire-haired fox terrier": 13.5, "yorkshire terrier": 13.3
|
116 |
}
|
117 |
|
118 |
-
# 4.HRQOL Framework with dropdown options
|
119 |
HRQOL_QUESTIONNAIRE = {
|
120 |
"vitality": {
|
121 |
"title": "🔋 Vitality & Energy Assessment",
|
@@ -645,23 +645,23 @@ def comprehensive_healthspan_analysis(input_type, image_input, video_input, bree
|
|
645 |
|
646 |
report_html += "</div>"
|
647 |
|
648 |
-
# Visual Analysis section with
|
649 |
if breed_info:
|
650 |
pace_info = ""
|
651 |
if age and age > 0:
|
652 |
pace = breed_info["bio_age"] / age
|
653 |
pace_status = "Accelerated" if pace > 1.2 else "Normal" if pace > 0.8 else "Slow"
|
654 |
pace_color = "#FF5722" if pace > 1.2 else "#4CAF50" if pace < 0.8 else "#FF9800"
|
655 |
-
pace_info = f"""<p style="margin: 8px 0;"><strong style="color: #
|
656 |
<span style="background: {pace_color}; color: white; padding: 4px 8px; border-radius: 12px; font-weight: bold; text-shadow: 1px 1px 1px rgba(0,0,0,0.3);">
|
657 |
{pace:.2f}× ({pace_status})</span></p>"""
|
658 |
|
659 |
report_html += f"""
|
660 |
<div style="border: 2px solid #2196F3; padding: 20px; border-radius: 12px; margin: 20px 0; background: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
661 |
-
<h3 style="color: #
|
662 |
-
<p style="margin: 8px 0; color: #
|
663 |
-
<p style="margin: 8px 0; color: #
|
664 |
-
<p style="margin: 8px 0; color: #
|
665 |
{pace_info}
|
666 |
</div>
|
667 |
"""
|
@@ -981,8 +981,6 @@ with gr.Blocks(
|
|
981 |
inputs=[input_type_dropdown, image_input, video_input, breed_input, age_input] + hrqol_inputs,
|
982 |
outputs=output_report
|
983 |
)
|
984 |
-
|
985 |
-
|
986 |
|
987 |
if __name__ == "__main__":
|
988 |
demo.launch()
|
|
|
115 |
"wire-haired fox terrier": 13.5, "yorkshire terrier": 13.3
|
116 |
}
|
117 |
|
118 |
+
# 4. VetMetrica HRQOL Framework with dropdown options
|
119 |
HRQOL_QUESTIONNAIRE = {
|
120 |
"vitality": {
|
121 |
"title": "🔋 Vitality & Energy Assessment",
|
|
|
645 |
|
646 |
report_html += "</div>"
|
647 |
|
648 |
+
# Visual Analysis section with black font color
|
649 |
if breed_info:
|
650 |
pace_info = ""
|
651 |
if age and age > 0:
|
652 |
pace = breed_info["bio_age"] / age
|
653 |
pace_status = "Accelerated" if pace > 1.2 else "Normal" if pace > 0.8 else "Slow"
|
654 |
pace_color = "#FF5722" if pace > 1.2 else "#4CAF50" if pace < 0.8 else "#FF9800"
|
655 |
+
pace_info = f"""<p style="margin: 8px 0;"><strong style="color: #000000;">Aging Pace:</strong>
|
656 |
<span style="background: {pace_color}; color: white; padding: 4px 8px; border-radius: 12px; font-weight: bold; text-shadow: 1px 1px 1px rgba(0,0,0,0.3);">
|
657 |
{pace:.2f}× ({pace_status})</span></p>"""
|
658 |
|
659 |
report_html += f"""
|
660 |
<div style="border: 2px solid #2196F3; padding: 20px; border-radius: 12px; margin: 20px 0; background: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
661 |
+
<h3 style="color: #000000; margin: 0 0 15px 0; font-weight: 600; border-bottom: 2px solid #E3F2FD; padding-bottom: 8px;">{input_type_icon} Visual Analysis</h3>
|
662 |
+
<p style="margin: 8px 0; color: #000000;"><strong>Detected Breed:</strong> <span style="color: #000000; font-weight: 600;">{breed_info['breed']}</span> <span style="background: #E3F2FD; color: #1976D2; padding: 2px 6px; border-radius: 8px; font-size: 0.9em;">({breed_info['confidence']:.1%} confidence)</span></p>
|
663 |
+
<p style="margin: 8px 0; color: #000000;"><strong>Estimated Biological Age:</strong> <span style="color: #000000; font-weight: 600;">{breed_info['bio_age']} years</span></p>
|
664 |
+
<p style="margin: 8px 0; color: #000000;"><strong>Chronological Age:</strong> <span style="color: #000000; font-weight: 600;">{age or 'Not provided'} years</span></p>
|
665 |
{pace_info}
|
666 |
</div>
|
667 |
"""
|
|
|
981 |
inputs=[input_type_dropdown, image_input, video_input, breed_input, age_input] + hrqol_inputs,
|
982 |
outputs=output_report
|
983 |
)
|
|
|
|
|
984 |
|
985 |
if __name__ == "__main__":
|
986 |
demo.launch()
|