Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,12 @@ def convert_and_save(image):
|
|
13 |
cv2.imwrite(output_path, gray_image)
|
14 |
return gray_image, output_path
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Gradio ์ธํฐํ์ด์ค ์ ์
|
17 |
iface = gr.Interface(
|
18 |
fn=convert_and_save,
|
@@ -20,13 +26,10 @@ iface = gr.Interface(
|
|
20 |
outputs=["image", "file"],
|
21 |
title="์ด๋ฏธ์ง ํ๋ฐฑ ๋ณํ๊ธฐ",
|
22 |
description="์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๋ฉด ํ๋ฐฑ์ผ๋ก ๋ณํํ๊ณ , PNG ํ์ผ๋ก ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.",
|
23 |
-
examples=
|
24 |
-
["example_image1.png"], # ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๊ฐ๋ฅํ ์์ ์ด๋ฏธ์ง 1
|
25 |
-
["example_image2.png"], # ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๊ฐ๋ฅํ ์์ ์ด๋ฏธ์ง 2
|
26 |
-
]
|
27 |
)
|
28 |
|
29 |
if __name__ == "__main__":
|
30 |
-
#
|
31 |
-
print("Ensure 'example_image1.png' and 'example_image2.png' exist in the directory.")
|
32 |
iface.launch()
|
|
|
13 |
cv2.imwrite(output_path, gray_image)
|
14 |
return gray_image, output_path
|
15 |
|
16 |
+
# ์์ ์ด๋ฏธ์ง๋ฅผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ก ํ์ํ ์ ์๋๋ก Gradio์ ๊ฒฝ๋ก ์ ๊ณต
|
17 |
+
examples = [
|
18 |
+
["example_image1.png"], # ์์ ์ด๋ฏธ์ง 1
|
19 |
+
["example_image2.png"], # ์์ ์ด๋ฏธ์ง 2
|
20 |
+
]
|
21 |
+
|
22 |
# Gradio ์ธํฐํ์ด์ค ์ ์
|
23 |
iface = gr.Interface(
|
24 |
fn=convert_and_save,
|
|
|
26 |
outputs=["image", "file"],
|
27 |
title="์ด๋ฏธ์ง ํ๋ฐฑ ๋ณํ๊ธฐ",
|
28 |
description="์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๋ฉด ํ๋ฐฑ์ผ๋ก ๋ณํํ๊ณ , PNG ํ์ผ๋ก ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.",
|
29 |
+
examples=examples
|
|
|
|
|
|
|
30 |
)
|
31 |
|
32 |
if __name__ == "__main__":
|
33 |
+
# ์์ ํ์ผ์ด ์คํ ๋๋ ํ ๋ฆฌ์ ์๋์ง ํ์ธ
|
34 |
+
print("Ensure 'example_image1.png' and 'example_image2.png' exist in the current directory.")
|
35 |
iface.launch()
|