ariankhalfani commited on
Commit
0f7ace5
1 Parent(s): fbd87f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
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
- <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>
@@ -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