AbdullahAj2000 commited on
Commit
dabe8da
·
verified ·
1 Parent(s): 5543a83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -48,7 +48,7 @@ def show_preds_image(image_path,model_selection):
48
  conf = (classify_image(image_path,model_selection))
49
  html = f'<p>petra</p><a href="https://www.gradio.app/docs/examples" target="_blank">"https://www.gradio.app/docs/examples"</a>'
50
  map_link = "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387195.9481044243!2d-74.25908989999999!3d40.6971494!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c24fa5d33f083b%3A0xc80b8f06e177fe62!2sNew%20York%2C%20NY!5e0!3m2!1sen!2sus!4v1645590913133!5m2!1sen!2sus"
51
- map =f'''
52
  <!DOCTYPE html>
53
  <html>
54
  <head>
@@ -59,9 +59,9 @@ def show_preds_image(image_path,model_selection):
59
  <iframe width="600" height="450" frameborder="0" style="border:0" src="{map_link}" allowfullscreen></iframe>
60
  </body>
61
  </html>
62
- '''
63
 
64
- return img,conf,html,map
65
 
66
 
67
  inputs_image = gr.Image(type="filepath", label="Input Image")
@@ -70,12 +70,12 @@ model_selection = gr.Dropdown(["VGG19","ResNet50","Efficientnet"])
70
  outputs_image = gr.Image(type="numpy", label="Output Image")
71
  output_text = gr.Textbox()
72
  link = gr.HTML()
73
- map = gr.HTML()
74
 
75
  interface_image = gr.Interface(
76
  fn=show_preds_image,
77
  inputs=[inputs_image,model_selection],
78
- outputs=[outputs_image,output_text,link],
79
  title="image classification",
80
  )
81
 
 
48
  conf = (classify_image(image_path,model_selection))
49
  html = f'<p>petra</p><a href="https://www.gradio.app/docs/examples" target="_blank">"https://www.gradio.app/docs/examples"</a>'
50
  map_link = "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387195.9481044243!2d-74.25908989999999!3d40.6971494!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c24fa5d33f083b%3A0xc80b8f06e177fe62!2sNew%20York%2C%20NY!5e0!3m2!1sen!2sus!4v1645590913133!5m2!1sen!2sus"
51
+ google_map =f'''
52
  <!DOCTYPE html>
53
  <html>
54
  <head>
 
59
  <iframe width="600" height="450" frameborder="0" style="border:0" src="{map_link}" allowfullscreen></iframe>
60
  </body>
61
  </html>
62
+ '''
63
 
64
+ return img,conf,html,google_map
65
 
66
 
67
  inputs_image = gr.Image(type="filepath", label="Input Image")
 
70
  outputs_image = gr.Image(type="numpy", label="Output Image")
71
  output_text = gr.Textbox()
72
  link = gr.HTML()
73
+ g_map = gr.HTML()
74
 
75
  interface_image = gr.Interface(
76
  fn=show_preds_image,
77
  inputs=[inputs_image,model_selection],
78
+ outputs=[outputs_image,output_text,link,g_map],
79
  title="image classification",
80
  )
81