Omnibus commited on
Commit
5cc4001
1 Parent(s): 87635c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -7,17 +7,22 @@ def rem_bg(input):
7
  result=rm(input)
8
  else:
9
  pass
10
- return gr.Pil.update(value=result)
11
 
12
  with gr.Blocks() as myface:
13
  gr.Markdown("""<center><h1>Fast Background Remover</h1><center>""")
14
- gr.Markdown("""<center>by: <a href='https://github.com/danielgatis/rembg' target='_blank'>Github Repo: danielgatis/rembg</a><center>""")
15
- with gr.Accordion("Details",open=False):
16
- gr.Markdown("""Drop your image in the box, and the background will be removed.""")
17
- with gr.Row():
18
- in_win=gr.Pil(label="Input", interactive=True, batch=True, max_batch_size=20)
19
- #out_win=gr.Pil(label="Output")
20
 
21
- in_win.change(rem_bg,in_win,in_win)
 
 
 
 
 
22
  myface.queue(concurrency_count=120)
23
  myface.launch()
 
7
  result=rm(input)
8
  else:
9
  pass
10
+ return result, gr.Accordion.update("Original Image",open=False)
11
 
12
  with gr.Blocks() as myface:
13
  gr.Markdown("""<center><h1>Fast Background Remover</h1><center>""")
14
+ gr.Column()
15
+ with gr.Column():
16
+ with gr.Accordion("Details",open=False):
17
+ gr.Markdown("""<center><h3>Drop your image in the box, and the background will be removed.</h3><center><br>""")
18
+ gr.Markdown("""<center><h5>Background Removal by:<a href='https://github.com/danielgatis/rembg' target='_blank'>Github Repo: danielgatis/rembg</h3></a><center>""")
19
+ gr.Markdown("""<center><h5>Huggingface Space by: <a href='https://twitter.com/omnibusai' target='_blank'>Omnibus</h3></a><center>""")
20
 
21
+ with gr.Accordion("Input Image",open=True) as og:
22
+ in_win=gr.Pil(label="Input", interactive=True, batch=True, max_batch_size=20)
23
+ out_win=gr.Pil(label="Output")
24
+ gr.Column()
25
+
26
+ in_win.change(rem_bg,in_win,[out_win,og])
27
  myface.queue(concurrency_count=120)
28
  myface.launch()