Update app.py
Browse files
app.py
CHANGED
|
@@ -44,17 +44,20 @@ with gr.Blocks() as app:
|
|
| 44 |
apply_button = gr.Button("ํํฐ ์ ์ฉ")
|
| 45 |
|
| 46 |
with gr.Row():
|
| 47 |
-
|
| 48 |
-
after_image = gr.Image(label="๋ณ๊ฒฝ ํ", type="pil")
|
| 49 |
|
| 50 |
-
def
|
| 51 |
filtered_image = apply_filter(image, filter_name, intensity)
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
apply_button.click(
|
| 55 |
-
fn=
|
| 56 |
inputs=[input_image, filter_name, intensity],
|
| 57 |
-
outputs=
|
| 58 |
)
|
| 59 |
|
| 60 |
# ์คํ
|
|
|
|
| 44 |
apply_button = gr.Button("ํํฐ ์ ์ฉ")
|
| 45 |
|
| 46 |
with gr.Row():
|
| 47 |
+
comparison = gr.Image(label="๋ณ๊ฒฝ ์ ํ ๋น๊ต", type="pil")
|
|
|
|
| 48 |
|
| 49 |
+
def apply_filter_and_compare(image, filter_name, intensity):
|
| 50 |
filtered_image = apply_filter(image, filter_name, intensity)
|
| 51 |
+
# ์ฌ๋ผ์ด๋๋ฅผ ์ํ ์ด๋ฏธ์ง ๊ฒฐํฉ
|
| 52 |
+
before_after = Image.new("RGB", (image.width * 2, image.height))
|
| 53 |
+
before_after.paste(image, (0, 0))
|
| 54 |
+
before_after.paste(filtered_image, (image.width, 0))
|
| 55 |
+
return before_after
|
| 56 |
|
| 57 |
apply_button.click(
|
| 58 |
+
fn=apply_filter_and_compare,
|
| 59 |
inputs=[input_image, filter_name, intensity],
|
| 60 |
+
outputs=comparison
|
| 61 |
)
|
| 62 |
|
| 63 |
# ์คํ
|