Update app.py
Browse files
app.py
CHANGED
@@ -79,25 +79,23 @@ def get_filter_description(filter_type):
|
|
79 |
}
|
80 |
return descriptions.get(filter_type, "")
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
title="์ด๋ฏธ์ง ํํฐ ๋ฐ ํ๋ฐฑ ๋ณํ๊ธฐ",
|
94 |
-
description="์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๊ณ ํํฐ์ ๊ฐ๋๋ฅผ ์ ํํ๋ฉด, ๋ณํ๋ ์ด๋ฏธ์ง๋ฅผ JPG ํ์ผ๋ก ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.",
|
95 |
-
live=True
|
96 |
-
)
|
97 |
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
|
|
|
|
102 |
|
103 |
iface.launch()
|
|
|
79 |
}
|
80 |
return descriptions.get(filter_type, "")
|
81 |
|
82 |
+
with gr.Blocks() as iface:
|
83 |
+
with gr.Row():
|
84 |
+
with gr.Column():
|
85 |
+
image_input = gr.Image(type="pil", label="์ด๋ฏธ์ง ์
๋ก๋")
|
86 |
+
filter_input = gr.Radio(
|
87 |
+
["Grayscale", "Soft Glow", "Portrait Enhancer", "Warm Tone", "Cold Tone", "High-Key", "Low-Key", "Haze"],
|
88 |
+
label="ํํฐ ์ ํ",
|
89 |
+
value="Soft Glow"
|
90 |
+
)
|
91 |
+
intensity_slider = gr.Slider(1, 100, value=50, label="ํํฐ ๊ฐ๋")
|
92 |
+
description_output = gr.Markdown(get_filter_description("Soft Glow"))
|
|
|
|
|
|
|
|
|
93 |
|
94 |
+
with gr.Column():
|
95 |
+
output_image = gr.Image(type="pil", label="๊ฒฐ๊ณผ ์ด๋ฏธ์ง")
|
96 |
|
97 |
+
filter_input.change(fn=lambda filter_type: get_filter_description(filter_type), inputs=filter_input, outputs=description_output)
|
98 |
+
process_button = gr.Button("ํํฐ ์ ์ฉ")
|
99 |
+
process_button.click(fn=convert_and_save, inputs=[image_input, filter_input, intensity_slider], outputs=output_image)
|
100 |
|
101 |
iface.launch()
|