SuriRaja commited on
Commit
eefefd3
Β·
verified Β·
1 Parent(s): 7eea7ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -1,5 +1,5 @@
1
  # Face Detection-Based AI Automation of Lab Tests
2
- # Redesigned UI using Clean Table Format for Results
3
 
4
  import gradio as gr
5
  import cv2
@@ -74,7 +74,7 @@ def analyze_face(image):
74
  build_table("❀️ Vital Signs", [("SpO2", spo2, (95, 100)), ("Heart Rate", heart_rate, (60, 100)), ("Respiratory Rate", rr, (12, 20))])
75
  ])
76
 
77
- summary = "<div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#fcfcfc;'>"
78
  summary += "<h4>πŸ“ Summary for You</h4><ul>"
79
  if hb < 13.5:
80
  summary += "<li>Your hemoglobin is a bit low β€” this could mean mild anemia. Consider a CBC test and iron supplements.</li>"
@@ -89,13 +89,14 @@ def analyze_face(image):
89
  summary += "</ul><p><strong>πŸ’‘ Tip:</strong> This is an AI-based screening and should be followed up with a lab visit for confirmation.</p></div>"
90
 
91
  html_output += summary
92
- html_output += "<br><div style='margin-top:20px;padding:12px;border:2px solid #2d87f0;background:#f2faff;text-align:center;border-radius:8px;">
93
- <h4>πŸ“ž Book a Lab Test</h4>
94
- <p>Prefer to get your tests confirmed at a nearby center? Click below to find certified labs in your area.</p>
95
- <button style='padding:10px 20px;background:#007BFF;color:#fff;border:none;border-radius:5px;cursor:pointer;'>Find Labs Near Me</button>
96
- </div>"
97
 
98
- lang_blocks = """
 
 
 
 
 
 
99
  <div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#f9f9f9;'>
100
  <h4>πŸ—£οΈ Summary in Your Language</h4>
101
  <details><summary><b>Hindi</b></summary><ul>
@@ -138,7 +139,7 @@ with gr.Blocks() as demo:
138
 
139
  gr.Markdown("""
140
  ---
141
- βœ… Table Format β€’ Color-coded Status β€’ Normal Range View
142
  """)
143
 
144
  demo.launch()
 
1
  # Face Detection-Based AI Automation of Lab Tests
2
+ # Redesigned UI using Clean Table Format for Results with Language Summary & Lab Booking
3
 
4
  import gradio as gr
5
  import cv2
 
74
  build_table("❀️ Vital Signs", [("SpO2", spo2, (95, 100)), ("Heart Rate", heart_rate, (60, 100)), ("Respiratory Rate", rr, (12, 20))])
75
  ])
76
 
77
+ summary = "<div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#fcfcfc;'>"
78
  summary += "<h4>πŸ“ Summary for You</h4><ul>"
79
  if hb < 13.5:
80
  summary += "<li>Your hemoglobin is a bit low β€” this could mean mild anemia. Consider a CBC test and iron supplements.</li>"
 
89
  summary += "</ul><p><strong>πŸ’‘ Tip:</strong> This is an AI-based screening and should be followed up with a lab visit for confirmation.</p></div>"
90
 
91
  html_output += summary
 
 
 
 
 
92
 
93
+ html_output += "<br><div style='margin-top:20px;padding:12px;border:2px solid #2d87f0;background:#f2faff;text-align:center;border-radius:8px;'>"
94
+ html_output += "<h4>πŸ“ž Book a Lab Test</h4>"
95
+ html_output += "<p>Prefer to get your tests confirmed at a nearby center? Click below to find certified labs in your area.</p>"
96
+ html_output += "<button style='padding:10px 20px;background:#007BFF;color:#fff;border:none;border-radius:5px;cursor:pointer;'>Find Labs Near Me</button>"
97
+ html_output += "</div>"
98
+
99
+ lang_blocks = """
100
  <div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#f9f9f9;'>
101
  <h4>πŸ—£οΈ Summary in Your Language</h4>
102
  <details><summary><b>Hindi</b></summary><ul>
 
139
 
140
  gr.Markdown("""
141
  ---
142
+ βœ… Table Format β€’ Color-coded Status β€’ Normal Range View β€’ Multilingual Summary β€’ Booking Prompt
143
  """)
144
 
145
  demo.launch()