AbdullahAj2000 commited on
Commit
3b8d4eb
·
verified ·
1 Parent(s): d8f9cde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -14
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import onnx
2
  import onnxruntime as ort
3
  import numpy as np
4
- from fpdf import FPDF
5
  import cv2
6
  import gradio as gr
7
 
@@ -138,18 +137,9 @@ def show_preds_image(image_path,model_selection):
138
  </body>
139
  </html>
140
  '''
141
- pdf = FPDF()
142
- pdf.add_page()
143
- pdf.image(image_path, x=10, y=10, w=190)
144
- pdf.set_font("Arial", style='B', size=16)
145
- pdf.ln(110)
146
- pdf.cell(0, 10, f"Prediction: {mux_value}", ln=True, align='C')
147
- pdf.set_font("Arial", size=12)
148
- pdf_buffer = BytesIO()
149
- pdf.output(pdf_buffer)
150
- pdf_buffer.seek(0)
151
 
152
- return img,conf,informations,link_info,google_map,pdf.output
153
 
154
  inputs_image = gr.Image(type="filepath", label="Input Image")
155
  model_selection = gr.Dropdown(["VGG19","InceptionV3","ResNet50","Efficientnet"],label="Model selection")
@@ -159,12 +149,12 @@ output_text = gr.Textbox(label="prediction & confidence")
159
  inform = gr.Textbox(label="Information about the place")
160
  g_map = gr.HTML(label="Place location")
161
  info_html = gr.HTML()
162
- pdf_output = gr.File(label="Download PDF")
163
 
164
  interface_image = gr.Interface(
165
  fn=show_preds_image,
166
  inputs=[inputs_image,model_selection],
167
- outputs=[outputs_image,output_text,inform,info_html,g_map,pdf_output],
168
  title="image classification",
169
  )
170
 
 
1
  import onnx
2
  import onnxruntime as ort
3
  import numpy as np
 
4
  import cv2
5
  import gradio as gr
6
 
 
137
  </body>
138
  </html>
139
  '''
140
+
 
 
 
 
 
 
 
 
 
141
 
142
+ return img,conf,informations,link_info,google_map
143
 
144
  inputs_image = gr.Image(type="filepath", label="Input Image")
145
  model_selection = gr.Dropdown(["VGG19","InceptionV3","ResNet50","Efficientnet"],label="Model selection")
 
149
  inform = gr.Textbox(label="Information about the place")
150
  g_map = gr.HTML(label="Place location")
151
  info_html = gr.HTML()
152
+
153
 
154
  interface_image = gr.Interface(
155
  fn=show_preds_image,
156
  inputs=[inputs_image,model_selection],
157
+ outputs=[outputs_image,output_text,inform,info_html,g_map],
158
  title="image classification",
159
  )
160