vitamom commited on
Commit
f168ec2
ยท
verified ยท
1 Parent(s): f93d8b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
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()