Spaces:
Sleeping
Sleeping
ariankhalfani
commited on
Commit
•
fbd87f3
1
Parent(s):
40136e2
Update app.py
Browse files
app.py
CHANGED
@@ -177,22 +177,27 @@ def append_patient_info_to_html(name, age, medical_record, sex, result, predicte
|
|
177 |
<html>
|
178 |
<body>
|
179 |
<h1>Patient Prediction Database</h1>
|
180 |
-
<table border="1" style="width:100%; border-collapse: collapse; text-align:
|
181 |
<tr>
|
182 |
-
<th>
|
183 |
-
<th>
|
|
|
|
|
|
|
|
|
184 |
</tr>
|
185 |
""")
|
186 |
|
187 |
-
# Append patient data
|
188 |
html_entry = f"""
|
189 |
-
<tr
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
196 |
"""
|
197 |
|
198 |
with open(html_db_file, 'a') as f:
|
@@ -200,7 +205,6 @@ def append_patient_info_to_html(name, age, medical_record, sex, result, predicte
|
|
200 |
|
201 |
return str(html_db_file) # Return the HTML file path for download
|
202 |
|
203 |
-
|
204 |
# Function to download the folders
|
205 |
def download_folder(folder):
|
206 |
zip_path = os.path.join(tempfile.gettempdir(), f"{folder}.zip")
|
|
|
177 |
<html>
|
178 |
<body>
|
179 |
<h1>Patient Prediction Database</h1>
|
180 |
+
<table border="1" style="width:100%; border-collapse: collapse; text-align: center;">
|
181 |
<tr>
|
182 |
+
<th>Name</th>
|
183 |
+
<th>Age</th>
|
184 |
+
<th>Medical Record</th>
|
185 |
+
<th>Sex</th>
|
186 |
+
<th>Result</th>
|
187 |
+
<th>Predicted Image</th>
|
188 |
</tr>
|
189 |
""")
|
190 |
|
191 |
+
# Append patient data in a horizontal format (values for each field under the corresponding header)
|
192 |
html_entry = f"""
|
193 |
+
<tr>
|
194 |
+
<td>{name}</td>
|
195 |
+
<td>{age}</td>
|
196 |
+
<td>{medical_record}</td>
|
197 |
+
<td>{sex}</td>
|
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:
|
|
|
205 |
|
206 |
return str(html_db_file) # Return the HTML file path for download
|
207 |
|
|
|
208 |
# Function to download the folders
|
209 |
def download_folder(folder):
|
210 |
zip_path = os.path.join(tempfile.gettempdir(), f"{folder}.zip")
|