arxivgpt kim commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,31 +97,24 @@ with gr.Blocks() as demo:
|
|
| 97 |
with gr.Column():
|
| 98 |
gr.Markdown("## BRIA RMBG 1.4")
|
| 99 |
gr.HTML('''
|
| 100 |
-
|
| 101 |
This is a demo for BRIA RMBG 1.4 that using
|
| 102 |
<a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
|
| 103 |
-
|
| 104 |
''')
|
| 105 |
input_image = gr.Image(type="pil")
|
| 106 |
output_image = gr.Image()
|
| 107 |
process_button = gr.Button("Remove Background")
|
| 108 |
process_button.click(fn=process, inputs=input_image, outputs=output_image)
|
| 109 |
|
| 110 |
-
|
| 111 |
-
with gr.Blocks() as demo:
|
| 112 |
with gr.Tab("Merge"):
|
| 113 |
with gr.Column():
|
| 114 |
-
org_image = gr.Image(label="Background", type='pil', image_mode='RGBA', height="40vh")
|
| 115 |
-
add_image = gr.Image(label="Foreground", type='pil', image_mode='RGBA', height="40vh")
|
| 116 |
scale = gr.Slider(minimum=10, maximum=200, step=1, value=100, label="Scale of Foreground Image (%)")
|
| 117 |
position = gr.Radio(choices=["중앙 가운데", "상단 좌측", "상단 가운데", "상단 우측", "중앙 좌측", "중앙 우측", "하단 좌측", "하단 가운데", "하단 우측"], value="중앙 가운데", label="Position of Foreground Image")
|
| 118 |
btn_merge = gr.Button("Merge Images")
|
| 119 |
-
result_merge = gr.Image(height="40vh")
|
|
|
|
| 120 |
|
| 121 |
-
btn_merge.click(
|
| 122 |
-
fn=merge,
|
| 123 |
-
inputs=[org_image, add_image, scale, position],
|
| 124 |
-
outputs=result_merge,
|
| 125 |
-
)
|
| 126 |
-
|
| 127 |
demo.launch()
|
|
|
|
| 97 |
with gr.Column():
|
| 98 |
gr.Markdown("## BRIA RMBG 1.4")
|
| 99 |
gr.HTML('''
|
| 100 |
+
<p style="margin-bottom: 10px; font-size: 94%">
|
| 101 |
This is a demo for BRIA RMBG 1.4 that using
|
| 102 |
<a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
|
| 103 |
+
</p>
|
| 104 |
''')
|
| 105 |
input_image = gr.Image(type="pil")
|
| 106 |
output_image = gr.Image()
|
| 107 |
process_button = gr.Button("Remove Background")
|
| 108 |
process_button.click(fn=process, inputs=input_image, outputs=output_image)
|
| 109 |
|
|
|
|
|
|
|
| 110 |
with gr.Tab("Merge"):
|
| 111 |
with gr.Column():
|
| 112 |
+
org_image = gr.Image(label="Background", type='pil', image_mode='RGBA', height="40vh")
|
| 113 |
+
add_image = gr.Image(label="Foreground", type='pil', image_mode='RGBA', height="40vh")
|
| 114 |
scale = gr.Slider(minimum=10, maximum=200, step=1, value=100, label="Scale of Foreground Image (%)")
|
| 115 |
position = gr.Radio(choices=["중앙 가운데", "상단 좌측", "상단 가운데", "상단 우측", "중앙 좌측", "중앙 우측", "하단 좌측", "하단 가운데", "하단 우측"], value="중앙 가운데", label="Position of Foreground Image")
|
| 116 |
btn_merge = gr.Button("Merge Images")
|
| 117 |
+
result_merge = gr.Image(height="40vh")
|
| 118 |
+
btn_merge.click(fn=merge, inputs=[org_image, add_image, scale, position], outputs=result_merge)
|
| 119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
demo.launch()
|