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()
|