Spaces:
fantos
/
Runtime error

arxivgpt kim commited on
Commit
39590b8
ยท
verified ยท
1 Parent(s): d508478

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -103,22 +103,16 @@ def add_blue_background(image):
103
  final_image = Image.alpha_composite(blue_background, image.convert("RGBA"))
104
  return final_image
105
 
106
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค์—์„œ ์ด๋ฏธ์ง€ ์ž…๋ ฅ๊ณผ ๋‘ ๊ฐœ์˜ ์ถœ๋ ฅ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
107
- inputs = gr.inputs.Image(type="pil")
108
- outputs = [gr.outputs.Image(type="pil", label="Background Removed"),
109
- gr.outputs.Image(type="pil", label="Blue Background Added")]
110
 
111
- def update_interface(image):
112
- transparent_image = process(image)
113
- blue_background_image = add_blue_background(transparent_image)
114
- return transparent_image, blue_background_image
115
 
116
- demo = gr.Interface(fn=update_interface,
117
  inputs=inputs,
118
  outputs=outputs,
119
- title="Background Removal and Add Blue Background",
120
- description="This adds a blue background to the transparent image.")
121
 
122
- # 'add' ๋ฒ„ํŠผ์„ ์ œ๊ฑฐํ–ˆ์œผ๋‚˜, ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ถ”๊ฐ€๋Š” ์ž๋™์œผ๋กœ ์ง„ํ–‰๋ฉ๋‹ˆ๋‹ค.
123
  if __name__ == "__main__":
124
- demo.launch()
 
 
103
  final_image = Image.alpha_composite(blue_background, image.convert("RGBA"))
104
  return final_image
105
 
 
 
 
 
106
 
107
+ inputs = "image" # ์ด์ „: gr.inputs.Image(type="pil") -> ๋ณ€๊ฒฝ: "image"
108
+ outputs = ["image"] # ์ด์ „ ๋ฐฉ์‹์—์„œ ๋ณ€๊ฒฝ๋˜์—ˆ์„ ์ˆ˜ ์žˆ๋Š” ์ถœ๋ ฅ ๋ถ€๋ถ„
 
 
109
 
110
+ demo = gr.Interface(fn=process,
111
  inputs=inputs,
112
  outputs=outputs,
113
+ title="Your Demo Title",
114
+ description="A brief description of your app.")
115
 
 
116
  if __name__ == "__main__":
117
+ demo.launch()
118
+