teenaxta commited on
Commit
192f350
·
verified ·
1 Parent(s): 8fbac75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -28,7 +28,11 @@ image_searcher = ImageSearcher(image_collection,
28
 
29
  def search_mongo(search_query):
30
  object = mongo_search(search_query)
31
- return object[0]['makeModel'], object[0]['photoUrls']
 
 
 
 
32
 
33
 
34
  def search_img(image):
@@ -72,9 +76,14 @@ with gr.Blocks() as demo:
72
  img_output_img = gr.Gallery(preview=True)
73
  img_output_text = gr.Textbox(label='Output car model', show_label=True)
74
 
 
75
  text_btn.click(search_mongo,
76
  inputs=text_input_text,
77
- outputs=[text_output_text, text_output_img])
 
 
 
 
78
 
79
 
80
  img_btn.click(search_img,
 
28
 
29
  def search_mongo(search_query):
30
  object = mongo_search(search_query)
31
+ return object[0]['makeModel'], object[0]['photoUrls'], \
32
+ object[1]['makeModel'], object[1]['photoUrls'], \
33
+ object[2]['makeModel'], object[2]['photoUrls'], \
34
+ object[3]['makeModel'], object[3]['photoUrls']
35
+
36
 
37
 
38
  def search_img(image):
 
76
  img_output_img = gr.Gallery(preview=True)
77
  img_output_text = gr.Textbox(label='Output car model', show_label=True)
78
 
79
+
80
  text_btn.click(search_mongo,
81
  inputs=text_input_text,
82
+ outputs=[text_output_text_1, text_output_img_1,
83
+ text_output_text_2, text_output_img_2,
84
+ text_output_text_3, text_output_img_3,
85
+ text_output_text_4, text_output_img_4])
86
+
87
 
88
 
89
  img_btn.click(search_img,