Spaces:
Sleeping
Sleeping
sayanbanerjee32
commited on
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -52,29 +52,32 @@ with gr.Blocks() as demo:
|
|
52 |
gr.HTML("<h1 align = 'center'> Image Search </h1>")
|
53 |
gr.HTML("<h4 align = 'center'> Identify the most suitable image for description provided.</h4>")
|
54 |
|
55 |
-
gr.
|
56 |
-
|
57 |
-
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
78 |
|
79 |
## for collab
|
80 |
# demo.launch(debug=True)
|
|
|
52 |
gr.HTML("<h1 align = 'center'> Image Search </h1>")
|
53 |
gr.HTML("<h4 align = 'center'> Identify the most suitable image for description provided.</h4>")
|
54 |
|
55 |
+
with gr.Row():
|
56 |
+
with gr.Column(scale=2):
|
57 |
+
gr.Gallery(value = original_images,
|
58 |
+
label="Images to search from", show_label=True, elem_id="gallery"
|
59 |
+
, columns=[3], rows=[3], object_fit="contain", height="auto")
|
60 |
|
61 |
+
with gr.Column(scale=2):
|
62 |
+
content = gr.Textbox(label = "Enter search text here")
|
63 |
+
inputs = [
|
64 |
+
content,
|
65 |
+
]
|
66 |
+
gr.Examples(["Page of text about segmentation",
|
67 |
+
"Facial photo of a tabby cat",
|
68 |
+
"Portrait of an astronaut with the American flag",
|
69 |
+
"Rocket standing on a launchpad",
|
70 |
+
"Red motorcycle standing in a garage",
|
71 |
+
"Person looking at a camera on a tripod",
|
72 |
+
"Black-and-white silhouette of a horse",
|
73 |
+
"Cup of coffee on a saucer",
|
74 |
+
"A snake in the background"],
|
75 |
+
inputs = inputs)
|
76 |
+
|
77 |
+
generate_btn = gr.Button(value = 'Identify')
|
78 |
+
outputs = [gr.Image(label = "Is this the image you are referring to?",
|
79 |
+
height = 512, width = 512)]
|
80 |
+
generate_btn.click(fn = identify_image, inputs= inputs, outputs = outputs)
|
81 |
|
82 |
## for collab
|
83 |
# demo.launch(debug=True)
|