sungdo1 commited on
Commit
036f159
โ€ข
1 Parent(s): 26a6581

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -1,22 +1,16 @@
1
  import gradio as gr
2
  from rembg import remove
3
 
4
- # ๋ฐฐ๊ฒฝ์„ ์ œ๊ฑฐํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
5
  def remove_background(image):
6
  output_image = remove(image)
7
  return output_image
8
 
9
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
10
  with gr.Blocks() as demo:
11
  with gr.Row():
12
- # ์‚ฌ์šฉ์ž๊ฐ€ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
13
- image_input = gr.Image(type="pil", tool="editor")
14
- # ๋ฐฐ๊ฒฝ์ด ์ œ๊ฑฐ๋œ ์ด๋ฏธ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
15
  image_output = gr.Image(type="pil")
16
 
17
- # ์‚ฌ์šฉ์ž๊ฐ€ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜๋ฉด `remove_background` ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜์–ด ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
18
  image_input.change(fn=remove_background, inputs=image_input, outputs=image_output)
19
 
20
- # ์•ฑ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
21
  if __name__ == "__main__":
22
  demo.launch()
 
1
  import gradio as gr
2
  from rembg import remove
3
 
 
4
  def remove_background(image):
5
  output_image = remove(image)
6
  return output_image
7
 
 
8
  with gr.Blocks() as demo:
9
  with gr.Row():
10
+ image_input = gr.Image(type="pil")
 
 
11
  image_output = gr.Image(type="pil")
12
 
 
13
  image_input.change(fn=remove_background, inputs=image_input, outputs=image_output)
14
 
 
15
  if __name__ == "__main__":
16
  demo.launch()