nkanungo commited on
Commit
942cbdf
·
1 Parent(s): 303a50f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -13
app.py CHANGED
@@ -96,17 +96,37 @@ def find_best_matches(image, mode, text):
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
 
 
96
  return matched_images
97
 
98
 
99
+ iface = gr.Interface(
100
+ fn=find_best_matches,
101
+ inputs=[
102
+ gr.Image(label="Image to search"),
103
+ gr.Radio([T2I, I2I], label="Search Mode"),
104
+ gr.Textbox(lines=1, label="Text Query", placeholder="Introduce the search text...")
105
+ ],
106
+ theme="grass",
107
+ outputs=[
108
+ gr.Gallery(
109
+ label="Generated images",
110
+ show_label=False,
111
+ elem_id="gallery"
112
+ ).style(grid=[2], height="auto")
113
+ ],
114
+ enable_queue=True,
115
+ title="CLIP Image Search",
116
+ 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: text or image form."
117
+ )
118
+
119
+ iface.launch()
120
+
121
+ # gr.Interface(fn=find_best_matches,
122
+ # inputs=[
123
+ # gr.Image(label="Image to search"),
124
+ # gr.Radio([T2I, I2I]),
125
+ # gr.Textbox(lines=1, label="Text query", placeholder="Introduce the search text...",
126
+ # )],
127
+ # theme="grass",
128
+ # outputs=[gr.Gallery(
129
+ # label="Generated images", show_label=False, elem_id="gallery"
130
+ # ).style(grid=[2], height="auto")], enable_queue=True, title="CLIP Image Search",
131
+ # 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()
132