Shivdutta commited on
Commit
4e5ae13
·
verified ·
1 Parent(s): 388f76d

Upload 6 files

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -94,19 +94,21 @@ def find_best_matches(image, mode, text):
94
  img = PILIMAGE.open(BytesIO(response.content))
95
  matched_images.append(img)
96
  return matched_images
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
 
99
 
100
-
101
- gr.Interface(fn=find_best_matches,
102
- inputs=[
103
- gr.Image(label="Image to search"),
104
- gr.Radio([T2I, I2I]),
105
- gr.Textbox(lines=1, label="Text query", placeholder="Introduce the search text...",
106
- )],
107
- theme="grass",
108
- outputs=[gr.Gallery(
109
- label="Generated images", show_label=False, elem_id="gallery"
110
- ).style(grid=[2], height="auto")], enable_queue=True, title="CLIP Image Search",
111
- description="This application displays TOP THREE images from Unsplash dataset that best match the search query provided by the user. Moreover, the input can be provided via two modes ie text or image form.").launch()
112
-
 
94
  img = PILIMAGE.open(BytesIO(response.content))
95
  matched_images.append(img)
96
  return matched_images
97
+
98
+
99
+ gr.Interface(
100
+ fn=find_best_matches,
101
+ inputs=[
102
+ gr.Image(label="Image to search"),
103
+ gr.Radio(choices=["T2I", "I2I"], label="Search Type"),
104
+ gr.Textbox(lines=1, label="Text query", placeholder="Introduce the search text...")
105
+ ],
106
+ outputs=[
107
+ gr.Gallery(label="Generated images", show_label=False, elem_id="gallery", scale=2)
108
+ ],
109
+ title="CLIP Image Search",
110
+ description="This application displays the TOP THREE images from the Unsplash dataset that best match the search query provided by the user. Moreover, the input can be provided via two modes: text or image."
111
+ ).launch()
112
 
113
 
114