Spaces:
Sleeping
Sleeping
ariankhalfani
commited on
Commit
•
0f7ace5
1
Parent(s):
fbd87f3
Update app.py
Browse files
app.py
CHANGED
@@ -175,20 +175,24 @@ def append_patient_info_to_html(name, age, medical_record, sex, result, predicte
|
|
175 |
with open(html_db_file, 'a') as f:
|
176 |
f.write("""
|
177 |
<html>
|
|
|
178 |
<body>
|
179 |
<h1>Patient Prediction Database</h1>
|
180 |
<table border="1" style="width:100%; border-collapse: collapse; text-align: center;">
|
181 |
-
<
|
182 |
-
<
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
189 |
""")
|
190 |
|
191 |
-
# Append patient data
|
192 |
html_entry = f"""
|
193 |
<tr>
|
194 |
<td>{name}</td>
|
@@ -198,11 +202,12 @@ def append_patient_info_to_html(name, age, medical_record, sex, result, predicte
|
|
198 |
<td>{result}</td>
|
199 |
<td><img src="data:image/png;base64,{predicted_image_base64}" alt="Predicted Image" width="150"></td>
|
200 |
</tr>
|
|
|
201 |
"""
|
202 |
|
203 |
with open(html_db_file, 'a') as f:
|
204 |
f.write(html_entry)
|
205 |
-
|
206 |
return str(html_db_file) # Return the HTML file path for download
|
207 |
|
208 |
# Function to download the folders
|
|
|
175 |
with open(html_db_file, 'a') as f:
|
176 |
f.write("""
|
177 |
<html>
|
178 |
+
<head><title>Patient Prediction Database</title></head>
|
179 |
<body>
|
180 |
<h1>Patient Prediction Database</h1>
|
181 |
<table border="1" style="width:100%; border-collapse: collapse; text-align: center;">
|
182 |
+
<thead>
|
183 |
+
<tr>
|
184 |
+
<th>Name</th>
|
185 |
+
<th>Age</th>
|
186 |
+
<th>Medical Record</th>
|
187 |
+
<th>Sex</th>
|
188 |
+
<th>Result</th>
|
189 |
+
<th>Predicted Image</th>
|
190 |
+
</tr>
|
191 |
+
</thead>
|
192 |
+
<tbody>
|
193 |
""")
|
194 |
|
195 |
+
# Append patient data with a horizontal line and descriptive headers
|
196 |
html_entry = f"""
|
197 |
<tr>
|
198 |
<td>{name}</td>
|
|
|
202 |
<td>{result}</td>
|
203 |
<td><img src="data:image/png;base64,{predicted_image_base64}" alt="Predicted Image" width="150"></td>
|
204 |
</tr>
|
205 |
+
<tr><td colspan="6"><hr></td></tr> <!-- Horizontal line across all columns -->
|
206 |
"""
|
207 |
|
208 |
with open(html_db_file, 'a') as f:
|
209 |
f.write(html_entry)
|
210 |
+
|
211 |
return str(html_db_file) # Return the HTML file path for download
|
212 |
|
213 |
# Function to download the folders
|