Update app.py
Browse files
app.py
CHANGED
|
@@ -114,18 +114,13 @@ def app():
|
|
| 114 |
summary_text = "<li>Your hemoglobin is a bit low...</li><li>Consider iron tests.</li>" # Placeholder
|
| 115 |
pdf_path = generate_pdf_report(image, results_dict, summary_text)
|
| 116 |
|
| 117 |
-
|
| 118 |
<table style='width:100%;border-collapse:collapse;margin-top:10px;'>
|
| 119 |
-
<tr><th
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
else:
|
| 125 |
-
table_html += f"<tr><td style='border:1px solid #ccc;padding:6px;'>{k}</td><td style='border:1px solid #ccc;padding:6px;'>{v}</td><td style='border:1px solid #ccc;padding:6px;'>-</td></tr>"
|
| 126 |
-
table_html += "</table>"
|
| 127 |
-
|
| 128 |
-
summary_block = """
|
| 129 |
<div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#f9f9f9;'>
|
| 130 |
<h4>📝 Summary in Your Language</h4>
|
| 131 |
<details><summary><b>Hindi</b></summary>
|
|
@@ -134,13 +129,14 @@ def app():
|
|
| 134 |
<details><summary><b>Telugu</b></summary>
|
| 135 |
<ul><li>మీ హిమోగ్లోబిన్ తక్కువగా ఉంది — ఇది అనీమియా సూచించవచ్చు. CBC, Iron పరీక్షలు చేయించండి.</li></ul>
|
| 136 |
</details>
|
| 137 |
-
</div>
|
|
|
|
| 138 |
<details><summary><b>Telugu</b></summary>
|
| 139 |
<ul><li>మీ హిమోగ్లోబిన్ తక్కువగా ఉంది — ఇది అనీమియా సూచించవచ్చు. CBC, Iron పరీక్షలు చేయించండి.</li></ul>
|
| 140 |
</details>
|
| 141 |
</div>"""
|
| 142 |
|
| 143 |
-
|
| 144 |
return full_html, frame_rgb, pdf_path
|
| 145 |
|
| 146 |
with gr.Blocks() as demo:
|
|
|
|
| 114 |
summary_text = "<li>Your hemoglobin is a bit low...</li><li>Consider iron tests.</li>" # Placeholder
|
| 115 |
pdf_path = generate_pdf_report(image, results_dict, summary_text)
|
| 116 |
|
| 117 |
+
table_html = """
|
| 118 |
<table style='width:100%;border-collapse:collapse;margin-top:10px;'>
|
| 119 |
+
<tr><th colspan='3' style='background:#ddd;text-align:left;padding:6px;'>🩸 Hematology</th></tr>
|
| 120 |
+
<tr><th style='border:1px solid #ccc;padding:6px;'>Test</th><th style='border:1px solid #ccc;padding:6px;'>Result</th><th style='border:1px solid #ccc;padding:6px;'>Level</th></tr>
|
| 121 |
+
"""
|
| 122 |
+
|
| 123 |
+
summary_block = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
<div style='margin-top:20px;padding:12px;border:1px dashed #999;background:#f9f9f9;'>
|
| 125 |
<h4>📝 Summary in Your Language</h4>
|
| 126 |
<details><summary><b>Hindi</b></summary>
|
|
|
|
| 129 |
<details><summary><b>Telugu</b></summary>
|
| 130 |
<ul><li>మీ హిమోగ్లోబిన్ తక్కువగా ఉంది — ఇది అనీమియా సూచించవచ్చు. CBC, Iron పరీక్షలు చేయించండి.</li></ul>
|
| 131 |
</details>
|
| 132 |
+
</div>
|
| 133 |
+
"""
|
| 134 |
<details><summary><b>Telugu</b></summary>
|
| 135 |
<ul><li>మీ హిమోగ్లోబిన్ తక్కువగా ఉంది — ఇది అనీమియా సూచించవచ్చు. CBC, Iron పరీక్షలు చేయించండి.</li></ul>
|
| 136 |
</details>
|
| 137 |
</div>"""
|
| 138 |
|
| 139 |
+
full_html = table_html + summary_block
|
| 140 |
return full_html, frame_rgb, pdf_path
|
| 141 |
|
| 142 |
with gr.Blocks() as demo:
|