sayanbanerjee32 commited on
Commit
d44bcd8
·
verified ·
1 Parent(s): 3b2349b

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +25 -22
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.Gallery(value = original_images,
56
- label="Images to search from", show_label=True, elem_id="gallery"
57
- , columns=[3], rows=[3], object_fit="contain", height="auto")
 
 
58
 
59
- content = gr.Textbox(label = "Enter search text here")
60
- inputs = [
61
- content,
62
- ]
63
- gr.Examples(["Page of text about segmentation",
64
- "Facial photo of a tabby cat",
65
- "Portrait of an astronaut with the American flag",
66
- "Rocket standing on a launchpad",
67
- "Red motorcycle standing in a garage",
68
- "Person looking at a camera on a tripod",
69
- "Black-and-white silhouette of a horse",
70
- "Cup of coffee on a saucer",
71
- "A snake in the background"],
72
- inputs = inputs)
73
-
74
- generate_btn = gr.Button(value = 'Identify')
75
- outputs = [gr.Image(label = "Is this the image you are referring to?",
76
- height = 512, width = 512)]
77
- generate_btn.click(fn = identify_image, inputs= inputs, outputs = outputs)
 
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)