Jaywalker061707 commited on
Commit
eb98500
·
verified ·
1 Parent(s): b8afcdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -99,4 +99,16 @@ with gr.Blocks() as demo:
99
 
100
  build_btn.click(build_index, inputs=n, outputs=status)
101
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  demo.launch()
 
99
 
100
  build_btn.click(build_index, inputs=n, outputs=status)
101
 
102
+ gr.Markdown("Search the index with text or an example image")
103
+
104
+ q_text = gr.Textbox(label="Text query", placeholder="e.g., spiral galaxy")
105
+ q_img = gr.Image(label="Image query", type="pil")
106
+ k = gr.Slider(1, 12, value=6, step=1, label="Top K")
107
+
108
+ search_btn = gr.Button("Search")
109
+ gallery = gr.Gallery(label="Results", columns=6, height=300)
110
+ info2 = gr.Textbox(label="Search status", lines=1)
111
+
112
+ search_btn.click(search, inputs=[q_text, q_img, k], outputs=[gallery, info2])
113
+
114
  demo.launch()