Update app.py
Browse files
app.py
CHANGED
|
@@ -293,8 +293,20 @@ def generate_combined_response(user_prompt):
|
|
| 293 |
upload_file_to_drive(drive, DRIVE_FOLDER_ID, jpg_filename_local, jpg_filename_local)
|
| 294 |
|
| 295 |
|
| 296 |
-
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
|
| 299 |
with gr.Blocks(css=css_code) as interface:
|
| 300 |
gr.Markdown("<h1 style='font-size:30px;'>์๋ก์ด ํฐ๋ํ์ด ๋ํ๋ฌ๋ค!</h1>")
|
|
|
|
| 293 |
upload_file_to_drive(drive, DRIVE_FOLDER_ID, jpg_filename_local, jpg_filename_local)
|
| 294 |
|
| 295 |
|
| 296 |
+
# ๊ทธ๋ผ๋์ค์์ ๋ณด์ฌ์ค ์ถ๋ ฅ(์ด๋ฏธ์ง)๊ณผ,
|
| 297 |
+
# ๋ ๋ฒ์งธ ๋ฒํผ์์ ํ์ฉํ ์ ์๋๋ก final_image๋ฅผ return
|
| 298 |
+
return final_image, final_image
|
| 299 |
+
|
| 300 |
+
def save_final_image(final_img):
|
| 301 |
+
"""
|
| 302 |
+
๋ ๋ฒ์งธ ๋ฒํผ์ ๋๋ ์ ๋(ํผ๋ฆฌํผ๋ฆฌ ์บ์น๋ง...),
|
| 303 |
+
์ด๋ฏธ ์์ฑ๋์ด ์๋ final_image๋ฅผ ๋ก์ปฌ์ ์ ์ฅํ๊ณ ,
|
| 304 |
+
ํด๋น ํ์ผ(๊ฒฝ๋ก)์ ๊ทธ๋ผ๋์ค File ์ปดํฌ๋ํธ๋ก ๋ฐํํ์ฌ ๋ค์ด๋ก๋ํ ์ ์๊ฒ ํจ.
|
| 305 |
+
"""
|
| 306 |
+
now_str = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 307 |
+
filename = f"caught_{now_str}.png"
|
| 308 |
+
final_img.save(filename)
|
| 309 |
+
return filename
|
| 310 |
|
| 311 |
with gr.Blocks(css=css_code) as interface:
|
| 312 |
gr.Markdown("<h1 style='font-size:30px;'>์๋ก์ด ํฐ๋ํ์ด ๋ํ๋ฌ๋ค!</h1>")
|