RashiAgarwal commited on
Commit
07bc4cc
·
1 Parent(s): 31ffc73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -25,7 +25,7 @@ description_p = """ # Acknowledgement
25
 
26
  """
27
 
28
- examples = [["examples/sa_8776.jpg"], ["examples/sa_414.jpg"], ["examples/sa_1309.jpg"], ["examples/sa_11025.jpg"],
29
  ["examples/sa_561.jpg"], ["examples/sa_192.jpg"], ["examples/sa_10039.jpg"], ["examples/sa_862.jpg"]]
30
 
31
  default_example = examples[0]
@@ -143,7 +143,7 @@ def get_points_with_draw(image, label, evt: gr.SelectData):
143
 
144
  cond_img_e = gr.Image(label="Input", value=default_example[0], type='pil')
145
  cond_img_p = gr.Image(label="Input with points", value=default_example[0], type='pil')
146
- cond_img_t = gr.Image(label="Input with text", value="examples/dogs.jpg", type='pil')
147
 
148
  segm_img_e = gr.Image(label="Segmented Image", interactive=False, type='pil')
149
  segm_img_p = gr.Image(label="Segmented Image with points", interactive=False, type='pil')
@@ -186,7 +186,7 @@ with gr.Blocks(title='Fast Segment Anything') as demo:
186
  segment_btn_e = gr.Button("Segment Everything", variant='primary')
187
  clear_btn_e = gr.Button("Clear", variant="secondary")
188
 
189
- gr.Markdown("Try some of the examples below ⬇️")
190
  gr.Examples(examples=examples,
191
  inputs=[cond_img_e],
192
  outputs=segm_img_e,
@@ -236,7 +236,7 @@ with gr.Blocks(title='Fast Segment Anything') as demo:
236
  segment_btn_p = gr.Button("Segment with points prompt", variant='primary')
237
  clear_btn_p = gr.Button("Clear points", variant='secondary')
238
 
239
- gr.Markdown("Try some of the examples below ⬇️")
240
  gr.Examples(examples=examples,
241
  inputs=[cond_img_p],
242
  # outputs=segm_img_p,
@@ -275,14 +275,14 @@ with gr.Blocks(title='Fast Segment Anything') as demo:
275
  with gr.Row():
276
  with gr.Column():
277
  contour_check = gr.Checkbox(value=True, label='withContours', info='draw the edges of the masks')
278
- text_box = gr.Textbox(label="text prompt", value="a black dog")
279
 
280
  with gr.Column():
281
  segment_btn_t = gr.Button("Segment with text", variant='primary')
282
  clear_btn_t = gr.Button("Clear", variant="secondary")
283
 
284
- gr.Markdown("Try some of the examples below ⬇️")
285
- gr.Examples(examples=[["examples/dogs.jpg"], ["examples/fruits.jpg"], ["examples/flowers.jpg"]],
286
  inputs=[cond_img_t],
287
  # outputs=segm_img_e,
288
  # fn=segment_everything,
 
25
 
26
  """
27
 
28
+ examples = [["examples/cat_dog.jpg"], ["examples/cars.jpg"], ["examples/ganesha.jpg"], ["examples/cats_monkey.jpg"],
29
  ["examples/sa_561.jpg"], ["examples/sa_192.jpg"], ["examples/sa_10039.jpg"], ["examples/sa_862.jpg"]]
30
 
31
  default_example = examples[0]
 
143
 
144
  cond_img_e = gr.Image(label="Input", value=default_example[0], type='pil')
145
  cond_img_p = gr.Image(label="Input with points", value=default_example[0], type='pil')
146
+ cond_img_t = gr.Image(label="Input with text", value="examples/cars.jpg", type='pil')
147
 
148
  segm_img_e = gr.Image(label="Segmented Image", interactive=False, type='pil')
149
  segm_img_p = gr.Image(label="Segmented Image with points", interactive=False, type='pil')
 
186
  segment_btn_e = gr.Button("Segment Everything", variant='primary')
187
  clear_btn_e = gr.Button("Clear", variant="secondary")
188
 
189
+ gr.Markdown("Try some of the examples below")
190
  gr.Examples(examples=examples,
191
  inputs=[cond_img_e],
192
  outputs=segm_img_e,
 
236
  segment_btn_p = gr.Button("Segment with points prompt", variant='primary')
237
  clear_btn_p = gr.Button("Clear points", variant='secondary')
238
 
239
+ gr.Markdown("Try some of the examples below")
240
  gr.Examples(examples=examples,
241
  inputs=[cond_img_p],
242
  # outputs=segm_img_p,
 
275
  with gr.Row():
276
  with gr.Column():
277
  contour_check = gr.Checkbox(value=True, label='withContours', info='draw the edges of the masks')
278
+ text_box = gr.Textbox(label="text prompt", value="a blue car")
279
 
280
  with gr.Column():
281
  segment_btn_t = gr.Button("Segment with text", variant='primary')
282
  clear_btn_t = gr.Button("Clear", variant="secondary")
283
 
284
+ gr.Markdown("Try some of the examples below")
285
+ gr.Examples(examples=[["examples/cars.jpg", text_box = "a blue car"], ["examples/cats_monkey.jpg",text_box = "a cat"], ["examples/cat_dog.jpg",text_box = "a dog"]],
286
  inputs=[cond_img_t],
287
  # outputs=segm_img_e,
288
  # fn=segment_everything,