Your hemoglobin is low — consider iron-rich diet or CBC test.
"
if iron < 60 or ferritin < 30:
summary += "
Low iron storage seen. Recommend Iron Profile Test.
"
if bilirubin > 1.2:
summary += "
Signs of jaundice. Suggest LFT confirmation.
"
if hba1c > 5.7:
summary += "
Elevated HbA1c — prediabetes alert.
"
if spo2 < 95:
summary += "
Low SpO2 — retest with oximeter if symptoms.
"
summary += "
💡 Tip: AI estimates — confirm with lab tests.
"
html_output += summary
html_output += "
"
html_output += "
📞 Book a Lab Test
Want to confirm these values? Click below to find certified labs near you.
"
html_output += "
"
lang_blocks = """
🗣️ Summary in Your Language
Hindi
आपका हीमोग्लोबिन थोड़ा कम है — यह हल्के एनीमिया का संकेत हो सकता है।
आयरन स्टोरेज कम है — आयरन प्रोफाइल टेस्ट कराएं।
जॉन्डिस के संकेत — LFT कराएं।
HbA1c बढ़ा हुआ — प्रीडायबिटीज़ का खतरा।
SpO2 कम है — पल्स ऑक्सीमीटर से जांचें।
Telugu
మీ హిమోగ్లోబిన్ తక్కువగా ఉంది — ఇది అనీమియా సంకేతం కావచ్చు.
Iron నిల్వలు తక్కువగా ఉన్నాయి — Iron ప్రొఫైల్ టెస్ట్ చేయించండి.
జాండిస్ లక్షణాలు — LFT చేయించండి.
HbA1c పెరిగినది — ప్రీ డయాబెటిస్ సూచన.
SpO2 తక్కువగా ఉంది — తిరిగి పరీక్షించండి.
"""
html_output += lang_blocks
return html_output, frame_rgb
with gr.Blocks() as demo:
gr.Markdown("""
# 🧠 Face-Based Lab Test AI Report
Upload a face photo to infer health diagnostics with AI-based visual markers.
""")
with gr.Row():
with gr.Column(scale=1):
image_input = gr.Image(type="numpy", label="📸 Upload Face Image")
submit_btn = gr.Button("🔍 Analyze")
with gr.Column(scale=2):
result_html = gr.HTML(label="🧪 Health Report Table")
result_image = gr.Image(label="📷 Face Scan Annotated")
submit_btn.click(fn=analyze_face, inputs=image_input, outputs=[result_html, result_image])
gr.Markdown("""
---
✅ Table Format • Color-coded Status • Summary & Multilingual Support • Lab Booking CTA
""")
demo.launch()