Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image, ImageEnhance, ImageOps, ImageFilter
|
| 3 |
-
import
|
| 4 |
|
| 5 |
def convert_to_moody_bw(image):
|
| 6 |
"""
|
|
@@ -31,12 +31,12 @@ def convert_and_prepare_download(image):
|
|
| 31 |
# JPG ํ์์ผ๋ก ๋ณํ
|
| 32 |
jpg_image = bw_image.convert("RGB")
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
|
| 39 |
-
return bw_image,
|
| 40 |
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
gr.Markdown("## ๋ถ์๊ธฐ ์๋ ํ๋ฐฑ ์ฌ์ง ๋ณํ๊ธฐ")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image, ImageEnhance, ImageOps, ImageFilter
|
| 3 |
+
import tempfile
|
| 4 |
|
| 5 |
def convert_to_moody_bw(image):
|
| 6 |
"""
|
|
|
|
| 31 |
# JPG ํ์์ผ๋ก ๋ณํ
|
| 32 |
jpg_image = bw_image.convert("RGB")
|
| 33 |
|
| 34 |
+
# ์์ ํ์ผ์ ์ด๋ฏธ์ง ์ ์ฅ
|
| 35 |
+
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmp_file:
|
| 36 |
+
jpg_image.save(tmp_file, format="JPEG")
|
| 37 |
+
tmp_file_path = tmp_file.name
|
| 38 |
|
| 39 |
+
return bw_image, tmp_file_path
|
| 40 |
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
gr.Markdown("## ๋ถ์๊ธฐ ์๋ ํ๋ฐฑ ์ฌ์ง ๋ณํ๊ธฐ")
|