Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from rembg import remove
|
3 |
+
|
4 |
+
def remove_background(input_image):
|
5 |
+
output_image = remove(input_image.read())
|
6 |
+
return output_image
|
7 |
+
|
8 |
+
with gr.Blocks() as demo:
|
9 |
+
gr.Markdown("### 배경 이미지 제거 프로그램")
|
10 |
+
with gr.Row():
|
11 |
+
with gr.Column():
|
12 |
+
input_image = gr.Image(type="pil", label="원본 이미지")
|
13 |
+
output_image = gr.Image(type="pil", label="배경 제거 이미지")
|
14 |
+
with gr.Column():
|
15 |
+
gr.Button("배경 제거").click(remove_background, inputs=input_image, outputs=output_image)
|
16 |
+
|
17 |
+
if __name__ == "__main__":
|
18 |
+
demo.launch()
|