arxivgpt kim
commited on
Update app.py
Browse files
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 |
-
|
112 |
-
|
113 |
-
blue_background_image = add_blue_background(transparent_image)
|
114 |
-
return transparent_image, blue_background_image
|
115 |
|
116 |
-
demo = gr.Interface(fn=
|
117 |
inputs=inputs,
|
118 |
outputs=outputs,
|
119 |
-
title="
|
120 |
-
description="
|
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 |
+
|