Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,9 +79,9 @@ def show_preds_image(image_path,model_selection):
|
|
| 79 |
|
| 80 |
conf = (classify_image(image_path,model_selection))
|
| 81 |
informations = information(mux_value)
|
| 82 |
-
html = f'<p>petra</p><a href="https://www.gradio.app/docs/examples" target="_blank">"https://www.gradio.app/docs/examples"</a>'
|
| 83 |
|
| 84 |
map_link = location(mux_value)
|
|
|
|
| 85 |
google_map = f'''
|
| 86 |
<!DOCTYPE html>
|
| 87 |
<html>
|
|
@@ -94,8 +94,19 @@ def show_preds_image(image_path,model_selection):
|
|
| 94 |
</body>
|
| 95 |
</html>
|
| 96 |
'''
|
| 97 |
-
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
|
| 101 |
inputs_image = gr.Image(type="filepath", label="Input Image")
|
|
@@ -104,14 +115,13 @@ model_selection = gr.Dropdown(["VGG19","ResNet50","Efficientnet"])
|
|
| 104 |
outputs_image = gr.Image(type="numpy", label="Output Image")
|
| 105 |
output_text = gr.Textbox()
|
| 106 |
inform = gr.Textbox()
|
| 107 |
-
link = gr.HTML()
|
| 108 |
g_map = gr.HTML()
|
| 109 |
-
|
| 110 |
|
| 111 |
interface_image = gr.Interface(
|
| 112 |
fn=show_preds_image,
|
| 113 |
inputs=[inputs_image,model_selection],
|
| 114 |
-
outputs=[outputs_image,output_text,inform,
|
| 115 |
title="image classification",
|
| 116 |
)
|
| 117 |
|
|
|
|
| 79 |
|
| 80 |
conf = (classify_image(image_path,model_selection))
|
| 81 |
informations = information(mux_value)
|
|
|
|
| 82 |
|
| 83 |
map_link = location(mux_value)
|
| 84 |
+
|
| 85 |
google_map = f'''
|
| 86 |
<!DOCTYPE html>
|
| 87 |
<html>
|
|
|
|
| 94 |
</body>
|
| 95 |
</html>
|
| 96 |
'''
|
| 97 |
+
img_link = "https://www.google.com/search?q=petra&tbm=isch&ved=2ahUKEwjmiYvyqv2DAxX8caQEHWz8At8Q2-cCegQIABAA&oq=petra&gs_lcp=CgNpbWcQAzIECCMQJzIECCMQJzIICAAQgAQQsQMyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEOgoIABCABBCKBRBDOg0IABCABBCKBRBDELEDUNIHWJ4RYL4TaABwAHgAgAGBAogB5AiSAQUwLjUuMZgBAKABAaoBC2d3cy13aXotaW1nwAEB&sclient=img&ei=kNe0ZeaBJ_zjkdUP7PiL-A0&authuser=0&bih=966&biw=1872&hl=en"
|
| 98 |
+
imagess=f''' <!DOCTYPE html>
|
| 99 |
+
<html>
|
| 100 |
+
<head>
|
| 101 |
+
<title>Map Display</title>
|
| 102 |
+
</head>
|
| 103 |
+
<body>
|
| 104 |
+
<h1>Map Display</h1>
|
| 105 |
+
<iframe width="600" height="450" frameborder="0" style="border:0" src="{img_link}" allowfullscreen></iframe>
|
| 106 |
+
</body>
|
| 107 |
+
</html>
|
| 108 |
+
'''
|
| 109 |
+
return img,conf,informations,imagess,google_map
|
| 110 |
|
| 111 |
|
| 112 |
inputs_image = gr.Image(type="filepath", label="Input Image")
|
|
|
|
| 115 |
outputs_image = gr.Image(type="numpy", label="Output Image")
|
| 116 |
output_text = gr.Textbox()
|
| 117 |
inform = gr.Textbox()
|
|
|
|
| 118 |
g_map = gr.HTML()
|
| 119 |
+
imgess= gr.HTML()
|
| 120 |
|
| 121 |
interface_image = gr.Interface(
|
| 122 |
fn=show_preds_image,
|
| 123 |
inputs=[inputs_image,model_selection],
|
| 124 |
+
outputs=[outputs_image,output_text,inform,imgess,g_map],
|
| 125 |
title="image classification",
|
| 126 |
)
|
| 127 |
|