AbdullahAj2000 commited on
Commit
73801fb
·
verified ·
1 Parent(s): e0c6de2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -8
app.py CHANGED
@@ -139,31 +139,43 @@ def show_preds_image(image_path,model_selection):
139
 
140
 
141
  return img,conf,informations,link_info,google_map
142
- elif 0.4float(classify_image(image_path,model_selection)[1])<0.85:
 
143
  img = cv2.imread(image_path)
144
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
145
  img = cv2.resize(img, (224, 224))
146
  conf = (classify_image(image_path,model_selection))
147
- informations = "I'm not sure pls try another input"
148
- link_info = f'''
 
 
 
149
  <!DOCTYPE html>
150
  <html>
151
  <head>
152
- <title>Links</title>
153
  </head>
154
  <body>
155
- <h1>NO link provide pls try another input</h1>
 
156
  </body>
157
  </html>
158
  '''
159
- google_map = f'''
 
160
  <!DOCTYPE html>
161
  <html>
162
  <head>
163
- <title>Map Display pls try another input</title>
164
  </head>
165
  <body>
166
- <h1>No location pls try another input</h1>
 
 
 
 
 
 
167
  </body>
168
  </html>
169
  '''
 
139
 
140
 
141
  return img,conf,informations,link_info,google_map
142
+ elif 0.4 <float(classify_image(image_path,model_selection)[1])<0.85:
143
+ mux_value = str(classify_image(image_path,model_selection)[0])
144
  img = cv2.imread(image_path)
145
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
146
  img = cv2.resize(img, (224, 224))
147
  conf = (classify_image(image_path,model_selection))
148
+ informations = "I'm not sure pls try another input it may be true"
149
+
150
+ map_link = location(mux_value)
151
+ links = links_info(mux_value)
152
+ google_map = f'''
153
  <!DOCTYPE html>
154
  <html>
155
  <head>
156
+ <title>Map Display</title>
157
  </head>
158
  <body>
159
+ <h1>Map Display</h1>
160
+ <iframe width="600" height="450" frameborder="0" style="border:0" src="{map_link}" allowfullscreen></iframe>
161
  </body>
162
  </html>
163
  '''
164
+
165
+ link_info = f'''
166
  <!DOCTYPE html>
167
  <html>
168
  <head>
169
+ <title>Links</title>
170
  </head>
171
  <body>
172
+ <h1>Useful Links</h1>
173
+
174
+ <ul>
175
+ <li>Restaurants : <a href="{links[0]}" target="_blank">{links[0]}</a></li>
176
+ <li>Hotels : <a href="{links[1]}" target="_blank">{links[1]}</a></li>
177
+ <li>Images : <a href="{links[2]}" target="_blank">{links[2]}</a></li>
178
+ </ul>
179
  </body>
180
  </html>
181
  '''