OriLib commited on
Commit
d909bca
1 Parent(s): 8e50ab7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -20
app.py CHANGED
@@ -83,25 +83,34 @@ def process(input_image):
83
  return [new_im]
84
 
85
 
86
- block = gr.Blocks().queue()
87
-
88
- with block:
89
- gr.Markdown("## BRIA RMBG 1.4")
90
- gr.HTML('''
91
- <p style="margin-bottom: 10px; font-size: 94%">
92
- This is a demo for BRIA RMBG 1.4 that using
93
- <a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
94
- </p>
95
- ''')
96
- with gr.Row():
97
- with gr.Column():
98
- input_image = gr.Image(sources=None, type="pil") # None for upload, ctrl+v and webcam
99
- # input_image = gr.Image(sources=None, type="numpy") # None for upload, ctrl+v and webcam
100
- run_button = gr.Button(value="Run")
101
 
102
- with gr.Column():
103
- result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[1], height='auto')
104
- ips = [input_image]
105
- run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
106
 
107
- block.launch(debug = True)
 
 
 
 
 
 
 
 
 
 
83
  return [new_im]
84
 
85
 
86
+ # block = gr.Blocks().queue()
87
+
88
+ # with block:
89
+ # gr.Markdown("## BRIA RMBG 1.4")
90
+ # gr.HTML('''
91
+ # <p style="margin-bottom: 10px; font-size: 94%">
92
+ # This is a demo for BRIA RMBG 1.4 that using
93
+ # <a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
94
+ # </p>
95
+ # ''')
96
+ # with gr.Row():
97
+ # with gr.Column():
98
+ # input_image = gr.Image(sources=None, type="pil") # None for upload, ctrl+v and webcam
99
+ # # input_image = gr.Image(sources=None, type="numpy") # None for upload, ctrl+v and webcam
100
+ # run_button = gr.Button(value="Run")
101
 
102
+ # with gr.Column():
103
+ # result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[1], height='auto')
104
+ # ips = [input_image]
105
+ # run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
106
 
107
+ # block.launch(debug = True)
108
+
109
+
110
+ title = "background_removal"
111
+ description = "remove image background"
112
+ examples = [['./input.jpg'],]
113
+ demo = gr.Interface(fn=process,inputs="image",outputs=ImageSlider(position=0.5,label='Image without background slider-view'),examples=examples,title=title,description=description)
114
+
115
+ if __name__ == "__main__":
116
+ demo.launch(share=False)