davertor commited on
Commit
caf85f0
·
1 Parent(s): 4fb79d3

First model version

Browse files
Files changed (1) hide show
  1. app.py +26 -7
app.py CHANGED
@@ -51,10 +51,29 @@ def find_best_matches(text_search, num_imgs=9):
51
 
52
 
53
 
54
- gr.Interface(fn=find_best_matches,
55
- inputs=[
56
- gr.inputs.Textbox(lines=1, label="Text query", placeholder="Introduce the search text...",
57
- )],
58
- theme="grass",
59
- outputs=gr.outputs.Carousel([gr.outputs.Image(type="pil")]), enable_queue=True, title="CLIP Image Search",
60
- 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()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
 
53
 
54
+ # gr.Interface(fn=find_best_matches,
55
+ # inputs=[
56
+ # gr.inputs.Textbox(lines=1, label="Text query", placeholder="Introduce the search text...",
57
+ # )],
58
+ # theme="grass",
59
+ # outputs=gr.outputs.Carousel([gr.outputs.Image(type="pil")]), enable_queue=True, title="CLIP Image Search",
60
+ # 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()
61
+
62
+
63
+ iface = gr.Interface(
64
+ title = "15K Nocturna valencia image search engine 📸",
65
+ description = "Image search engine from a text input for the photo gallery of 15k Nocturna Valencia running race based on their semantic content.",
66
+ article = "You find more information about this demo on my ✨ github repository [davertor](https://github.com/davertor/image-search-engine-for-flickr-photos-gallery)",
67
+ fn=find_best_matches,
68
+ inputs=[
69
+ gr.inputs.Textbox(
70
+ lines=1,
71
+ label="Write what you are looking for in an image...",
72
+ placeholder="Text Here..."),
73
+ gr.inputs.Slider(0, 9, step=1)
74
+ ],
75
+ outputs=gr.outputs.Carousel(gr.outputs.Image(type="pil")),
76
+ examples=[
77
+ [("persons in the finish line"), 3],
78
+ ]
79
+ ).launch(debug=True)