AbdullahAj2000 commited on
Commit
8cf818e
·
verified ·
1 Parent(s): ff7de67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -86,14 +86,13 @@ def classify_image(input_image,model_selection):
86
 
87
  return predicted_class, confidence
88
 
89
- def pdf_download(image_path,predicted_class,confidence):
90
  pdf = FPDF()
91
  pdf.add_page()
92
  pdf.image(image_path, x=10, y=10, w=190)
93
  pdf.set_font("Arial", style='B', size=16)
94
  pdf.ln(110)
95
  pdf.cell(0, 10, f"Prediction: {predicted_class}", ln=True, align='C')
96
- pdf.cell(0, 10, f"Confidence: {confidence:.2%}", ln=True, align='C')
97
  pdf.set_font("Arial", size=12)
98
  pdf.ln(10)
99
  pdf.multi_cell(0, 10, information_text)
@@ -155,7 +154,7 @@ def show_preds_image(image_path,model_selection):
155
  </body>
156
  </html>
157
  '''
158
- _pdf =pdf_download(image_path,mux_value,float(conf[-1]))
159
  return img,conf,informations,link_info,google_map,_pdf
160
 
161
  inputs_image = gr.Image(type="filepath", label="Input Image")
 
86
 
87
  return predicted_class, confidence
88
 
89
+ def pdf_download(image_path,predicted_class):
90
  pdf = FPDF()
91
  pdf.add_page()
92
  pdf.image(image_path, x=10, y=10, w=190)
93
  pdf.set_font("Arial", style='B', size=16)
94
  pdf.ln(110)
95
  pdf.cell(0, 10, f"Prediction: {predicted_class}", ln=True, align='C')
 
96
  pdf.set_font("Arial", size=12)
97
  pdf.ln(10)
98
  pdf.multi_cell(0, 10, information_text)
 
154
  </body>
155
  </html>
156
  '''
157
+ _pdf =pdf_download(image_path,mux_value)
158
  return img,conf,informations,link_info,google_map,_pdf
159
 
160
  inputs_image = gr.Image(type="filepath", label="Input Image")