File size: 13,643 Bytes
8d852cf ac7fd78 a7e1681 8d852cf ddcfe75 8d852cf 1d396b2 e0e8bcb 1d396b2 77a62b5 8d852cf ddcfe75 ba3536d ac7fd78 4718cfc ac7fd78 4718cfc 14ca9a3 ac7fd78 d53a3c8 efacf1e 1d396b2 efacf1e d53a3c8 1d396b2 d53a3c8 4718cfc efacf1e 1d396b2 d53a3c8 1d396b2 d53a3c8 1d396b2 d53a3c8 1d396b2 4718cfc d53a3c8 4718cfc d53a3c8 1d396b2 d53a3c8 1d396b2 d53a3c8 c17a6b6 d53a3c8 efacf1e 1d396b2 d53a3c8 4718cfc d53a3c8 4718cfc efacf1e d53a3c8 4718cfc efacf1e 1d396b2 d53a3c8 efacf1e 4718cfc d53a3c8 4718cfc ddcfe75 d86f643 3e624fe 4718cfc 3e624fe 4718cfc ba3536d 451a0ee 3e624fe 4718cfc 3e624fe 0fee2a2 4718cfc 0fee2a2 ba3536d 0fee2a2 3e624fe 0fee2a2 3e624fe 4718cfc 3e624fe 1d396b2 3e624fe 4718cfc 0fee2a2 3e624fe 0fee2a2 ba3536d 4718cfc 0fee2a2 ba3536d 4718cfc ba3536d 4718cfc ba3536d 4718cfc ba3536d 4718cfc ba3536d 1d396b2 4718cfc 9287902 ba3536d 1d396b2 4718cfc 1d396b2 ba3536d 1d396b2 ba3536d c1f6fb2 ba3536d 4718cfc ba3536d 4718cfc 0fee2a2 ba3536d 0fee2a2 ba3536d 0fee2a2 ba3536d 5dfaa58 4718cfc ba3536d 5dfaa58 ba3536d 4718cfc 0fee2a2 ba3536d 4718cfc 0fee2a2 ba3536d 0fee2a2 ba3536d ac7fd78 1d396b2 5ff01f8 0fee2a2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
import os
import tempfile
from PIL import Image
import gradio as gr
import logging
import re
import io
from io import BytesIO
from google import genai
from google.genai import types
# ํ๊ฒฝ๋ณ์ ๋ก๋
from dotenv import load_dotenv
load_dotenv()
# ๋ก๊น
์ค์
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def save_binary_file(file_name, data):
with open(file_name, "wb") as f:
f.write(data)
def preprocess_prompt(prompt, image1, image2, image3):
"""
ํ๋กฌํํธ๋ฅผ ์ฒ๋ฆฌํ๊ณ ๊ธฐ๋ฅ ๋ช
๋ น์ ํด์
"""
# ๊ธฐ์กด preprocess_prompt ํจ์ ์ฝ๋ ์ ์ง
# ์ด๋ฏธ์ง ์๋ ์ฐธ์กฐ ํ์ธ ๋ฐ ์ฒ๋ฆฌ
has_img1 = image1 is not None
has_img2 = image2 is not None
has_img3 = image3 is not None
# #1, #2, #3 ์ฐธ์กฐ๋ฅผ ์ค๋ช
์ผ๋ก ๋ณํ (์ด๋ฏธ์ง๊ฐ ์๋ ๊ฒฝ์ฐ ๋ฌด์)
if "#1" in prompt and not has_img1:
prompt = prompt.replace("#1", "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง(์์)")
else:
prompt = prompt.replace("#1", "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง")
if "#2" in prompt and not has_img2:
prompt = prompt.replace("#2", "๋ ๋ฒ์งธ ์ด๋ฏธ์ง(์์)")
else:
prompt = prompt.replace("#2", "๋ ๋ฒ์งธ ์ด๋ฏธ์ง")
if "#3" in prompt and not has_img3:
prompt = prompt.replace("#3", "์ธ ๋ฒ์งธ ์ด๋ฏธ์ง(์์)")
else:
prompt = prompt.replace("#3", "์ธ ๋ฒ์งธ ์ด๋ฏธ์ง")
# ๊ธฐ๋ฅ ๋ช
๋ น ํด์
if "1. ์ด๋ฏธ์ง ๋ณ๊ฒฝ" in prompt:
# ์ค๋ช
์ถ์ถ์ ์๋ํ์ง๋ง ์คํจํด๋ ๊ธฐ๋ณธ ํ๋กฌํํธ ์ ๊ณต
desc_match = re.search(r'#1์ "(.*?)"์ผ๋ก ๋ฐ๊ฟ๋ผ', prompt)
if desc_match:
description = desc_match.group(1)
prompt = f"์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ {description}์ผ๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์. ์๋ณธ ์ด๋ฏธ์ง์ ์ฃผ์ ๋ด์ฉ์ ์ ์งํ๋ ์๋ก์ด ์คํ์ผ๊ณผ ๋ถ์๊ธฐ๋ก ์ฌํด์ํด์ฃผ์ธ์."
else:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์ฐฝ์์ ์ผ๋ก ๋ณํํด์ฃผ์ธ์. ๋ ์์ํ๊ณ ์์ ์ ์ธ ๋ฒ์ ์ผ๋ก ๋ง๋ค์ด์ฃผ์ธ์."
elif "2. ๊ธ์์ง์ฐ๊ธฐ" in prompt:
# ์ง์ธ ํ
์คํธ ์ถ์ถ์ ์๋ํ์ง๋ง ์คํจํด๋ ๊ธฐ๋ณธ ํ๋กฌํํธ ์ ๊ณต
text_match = re.search(r'#1์์ "(.*?)"๋ฅผ ์ง์๋ผ', prompt)
if text_match:
text_to_remove = text_match.group(1)
prompt = f"์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์์ '{text_to_remove}' ํ
์คํธ๋ฅผ ์ฐพ์ ์์ฐ์ค๋ฝ๊ฒ ์ ๊ฑฐํด์ฃผ์ธ์. ํ
์คํธ๊ฐ ์๋ ๋ถ๋ถ์ ๋ฐฐ๊ฒฝ๊ณผ ์กฐํ๋กญ๊ฒ ์ฑ์์ฃผ์ธ์."
else:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์์ ๋ชจ๋ ํ
์คํธ๋ฅผ ์ฐพ์ ์์ฐ์ค๋ฝ๊ฒ ์ ๊ฑฐํด์ฃผ์ธ์. ๊น๋ํ ์ด๋ฏธ์ง๋ก ๋ง๋ค์ด์ฃผ์ธ์."
elif "3. ์ผ๊ตด๋ฐ๊พธ๊ธฐ" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ธ๋ฌผ ์ผ๊ตด์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ผ๊ตด๋ก ์์ฐ์ค๋ฝ๊ฒ ๊ต์ฒดํด์ฃผ์ธ์. ์ผ๊ตด์ ํ์ ๊ณผ ํน์ง์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๋ฅด๋, ๋๋จธ์ง ๋ถ๋ถ์ ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์ ์งํด์ฃผ์ธ์."
elif "4. ์ท๋ฐ๊พธ๊ธฐ" in prompt:
# ์ฌ๋ฌ ์ด๋ฏธ์ง ์ฐธ์กฐ ์ฒ๋ฆฌ
if "#3" in prompt or "๋๋ #3" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ธ๋ฌผ ์์์ ๋ ๋ฒ์งธ ๋๋ ์ธ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์์์ผ๋ก ์์ฐ์ค๋ฝ๊ฒ ๊ต์ฒดํด์ฃผ์ธ์. ์์์ ์คํ์ผ๊ณผ ์์์ ์ฐธ์กฐ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๋ฅด๋, ์ ์ฒด ๋น์จ๊ณผ ํฌ์ฆ๋ ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์ ์งํด์ฃผ์ธ์."
else:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ธ๋ฌผ ์์์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์์์ผ๋ก ์์ฐ์ค๋ฝ๊ฒ ๊ต์ฒดํด์ฃผ์ธ์. ์์์ ์คํ์ผ๊ณผ ์์์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๋ฅด๋, ์ ์ฒด ๋น์จ๊ณผ ํฌ์ฆ๋ ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์ ์งํด์ฃผ์ธ์."
elif "5. ๋ฐฐ๊ฒฝ๋ฐ๊พธ๊ธฐ" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ฐฐ๊ฒฝ์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ฐฐ๊ฒฝ์ผ๋ก ์์ฐ์ค๋ฝ๊ฒ ๊ต์ฒดํด์ฃผ์ธ์. ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ฃผ์ ํผ์ฌ์ฒด๋ ์ ์งํ๊ณ , ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ฐฐ๊ฒฝ๊ณผ ์กฐํ๋กญ๊ฒ ํฉ์ฑํด์ฃผ์ธ์."
elif "6. ์ด๋ฏธ์ง ํฉ์ฑ(์ํํฌํจ)" in prompt:
# ์ฌ๋ฌ ์ด๋ฏธ์ง ์ฐธ์กฐ ์ฒ๋ฆฌ
if "#3" in prompt or "๋๋ #3" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ ๋ฒ์งธ, ์ธ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์์ฐ์ค๋ฝ๊ฒ ํฉ์ฑํด์ฃผ์ธ์. ๋ชจ๋ ์ด๋ฏธ์ง์ ์ฃผ์ ์์๋ฅผ ํฌํจํ๊ณ , ํนํ ์ํ์ด ์ ๋ณด์ด๋๋ก ์กฐํ๋กญ๊ฒ ํตํฉํด์ฃผ์ธ์."
else:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ์์ฐ์ค๋ฝ๊ฒ ํฉ์ฑํด์ฃผ์ธ์. ๋ ์ด๋ฏธ์ง์ ์ฃผ์ ์์๋ฅผ ํฌํจํ๊ณ , ํนํ ์ํ์ด ์ ๋ณด์ด๋๋ก ์กฐํ๋กญ๊ฒ ํตํฉํด์ฃผ์ธ์."
elif "7. ์ด๋ฏธ์ง ํฉ์ฑ(์คํ์ผ์ ์ฉ)" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ๋ด์ฉ์ ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์คํ์ผ๋ก ๋ณํํด์ฃผ์ธ์. ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ฃผ์ ํผ์ฌ์ฒด์ ๊ตฌ๋๋ ์ ์งํ๋, ๋ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์์ ์ ์คํ์ผ, ์์, ์ง๊ฐ์ ์ ์ฉํด์ฃผ์ธ์."
# ๊ฐ๋จํ ์์ ๋ณ๊ฒฝ ์์ฒญ ์ฒ๋ฆฌ
elif "์ ๋ถ์์์ผ๋ก ๋ฐ๊ฟ๋ผ" in prompt or "๋ฅผ ๋ถ์์์ผ๋ก ๋ฐ๊ฟ๋ผ" in prompt:
prompt = "์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง๋ฅผ ๋ถ์์ ํค์ผ๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์. ์ ์ฒด์ ์ธ ์์์ ๋ถ์ ๊ณ์ด๋ก ์กฐ์ ํ๊ณ ์์ฐ์ค๋ฌ์ด ๋๋์ ์ ์งํด์ฃผ์ธ์."
# ๋ช
ํํ ์ด๋ฏธ์ง ์์ฑ ์์ฒญ ์ถ๊ฐ
prompt += " ์ด๋ฏธ์ง๋ฅผ ์์ฑํด์ฃผ์ธ์."
return prompt
def generate_with_images(prompt, images):
"""
๊ณต์ ๋ฌธ์์ ๊ธฐ๋ฐํ ์ฌ๋ฐ๋ฅธ API ํธ์ถ ๋ฐฉ์ ๊ตฌํ
"""
try:
# API ํค ํ์ธ
api_key = os.environ.get("GEMINI_API_KEY")
if not api_key:
return None, "API ํค๊ฐ ์ค์ ๋์ง ์์์ต๋๋ค. ํ๊ฒฝ๋ณ์๋ฅผ ํ์ธํด์ฃผ์ธ์."
# Gemini ํด๋ผ์ด์ธํธ ์ด๊ธฐํ
client = genai.Client(api_key=api_key)
logger.info(f"Gemini API ์์ฒญ ์์ - ํ๋กฌํํธ: {prompt}")
# ์ปจํ
์ธ ์ค๋น
contents = []
# ํ
์คํธ ํ๋กฌํํธ ์ถ๊ฐ
contents.append(prompt)
# ์ด๋ฏธ์ง ์ถ๊ฐ
for idx, img in enumerate(images, 1):
if img is not None:
contents.append(img)
logger.info(f"์ด๋ฏธ์ง #{idx} ์ถ๊ฐ๋จ")
# ์์ฑ ์ค์ - ๊ณต์ ๋ฌธ์์ ๋ฐ๋ผ responseModalities ์ค์
response = client.models.generate_content(
model="gemini-2.0-flash-exp-image-generation",
contents=contents,
config=types.GenerateContentConfig(
response_modalities=['Text', 'Image'],
temperature=1,
top_p=0.95,
top_k=40,
max_output_tokens=8192
)
)
# ์์ ํ์ผ ์์ฑ
with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as tmp:
temp_path = tmp.name
result_text = ""
image_found = False
# ์๋ต ์ฒ๋ฆฌ
for part in response.candidates[0].content.parts:
if hasattr(part, 'text') and part.text:
result_text += part.text
logger.info(f"์๋ต ํ
์คํธ: {part.text}")
elif hasattr(part, 'inline_data') and part.inline_data:
save_binary_file(temp_path, part.inline_data.data)
image_found = True
logger.info("์๋ต์์ ์ด๋ฏธ์ง ์ถ์ถ ์ฑ๊ณต")
if not image_found:
return None, f"API์์ ์ด๋ฏธ์ง๋ฅผ ์์ฑํ์ง ๋ชปํ์ต๋๋ค. ์๋ต ํ
์คํธ: {result_text}"
# ๊ฒฐ๊ณผ ์ด๋ฏธ์ง ๋ฐํ
result_img = Image.open(temp_path)
if result_img.mode == "RGBA":
result_img = result_img.convert("RGB")
return result_img, f"์ด๋ฏธ์ง๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์์ฑ๋์์ต๋๋ค. {result_text}"
except Exception as e:
logger.exception("์ด๋ฏธ์ง ์์ฑ ์ค ์ค๋ฅ ๋ฐ์:")
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}"
def process_images_with_prompt(image1, image2, image3, prompt):
"""
3๊ฐ์ ์ด๋ฏธ์ง์ ํ๋กฌํํธ๋ฅผ ์ฒ๋ฆฌํ๋ ํจ์
"""
try:
# ์ด๋ฏธ์ง ๊ฐ์ ํ์ธ
images = [image1, image2, image3]
valid_images = [img for img in images if img is not None]
if not valid_images:
return None, "์ ์ด๋ ํ๋์ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํด์ฃผ์ธ์."
# ํ๋กฌํํธ ์ฒ๋ฆฌ
if not prompt or not prompt.strip():
# ํ๋กฌํํธ๊ฐ ์์ผ๋ฉด ์
๋ก๋๋ ์ด๋ฏธ์ง ์์ ๋ฐ๋ผ ์๋ ํฉ์ฑ ํ๋กฌํํธ๋ฅผ ์์ด๋ก ์์ฑ
if len(valid_images) == 1:
prompt = "Please creatively transform this image into a more vivid and artistic version."
logger.info("Default prompt generated for single image")
elif len(valid_images) == 2:
prompt = "Please seamlessly composite these two images, integrating their key elements harmoniously into a single image."
logger.info("Default prompt generated for two images")
else:
prompt = "Please creatively composite these three images, combining their main elements into a cohesive and natural scene."
logger.info("Default prompt generated for three images")
else:
# ํ๋กฌํํธ ์ ์ฒ๋ฆฌ ๋ฐ ๊ธฐ๋ฅ ๋ช
๋ น ํด์
prompt = preprocess_prompt(prompt, image1, image2, image3)
# ์๋ก์ด API ํธ์ถ ๋ฐฉ์ ์ฌ์ฉ
return generate_with_images(prompt, valid_images)
except Exception as e:
logger.exception("์ด๋ฏธ์ง ์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}"
# (๊ธฐ๋ฅ ์ ํ ๊ด๋ จ ์ฝ๋ ์ ์ฒด ์ญ์ ๋จ)
# Gradio ์ธํฐํ์ด์ค
with gr.Blocks() as demo:
gr.HTML(
"""
<div style="text-align: center; margin-bottom: 1rem;">
<h1>๊ฐ๋จํ ์ด๋ฏธ์ง ์์ฑ๊ธฐ</h1>
<p>์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๊ณ ๋ฐ๋ก ์คํํ๋ฉด ์๋์ผ๋ก ํฉ์ฑํฉ๋๋ค.</p>
</div>
"""
)
with gr.Row():
with gr.Column():
# 3๊ฐ์ ์ด๋ฏธ์ง ์
๋ ฅ
with gr.Row():
image1_input = gr.Image(type="pil", label="#1", image_mode="RGB")
image2_input = gr.Image(type="pil", label="#2", image_mode="RGB")
image3_input = gr.Image(type="pil", label="#3", image_mode="RGB")
# ํ๋กฌํํธ ์
๋ ฅ (์ ํ ์ฌํญ)
prompt_input = gr.Textbox(
lines=3,
placeholder="ํ๋กฌํํธ๋ฅผ ์
๋ ฅํ๊ฑฐ๋ ๋น์๋๋ฉด ์๋ ํฉ์ฑ๋ฉ๋๋ค.",
label="ํ๋กฌํํธ (์ ํ ์ฌํญ)"
)
# ์์ฑ ๋ฒํผ
submit_btn = gr.Button("์ด๋ฏธ์ง ์์ฑ", variant="primary")
with gr.Column():
# ๊ฒฐ๊ณผ ์ถ๋ ฅ
output_image = gr.Image(label="์์ฑ๋ ์ด๋ฏธ์ง")
output_text = gr.Textbox(label="์ํ ๋ฉ์์ง")
# ์ฌ์ฉ๋ ํ๋กฌํํธ ํ์
prompt_display = gr.Textbox(label="์ฌ์ฉ๋ ํ๋กฌํํธ", visible=True)
# ์ด๋ฏธ์ง ์์ฑ ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ
def process_and_show_prompt(image1, image2, image3, prompt):
# ์ด๋ฏธ์ง ๊ฐ์ ํ์ธ
images = [image1, image2, image3]
valid_images = [img for img in images if img is not None]
try:
# ์๋ ํ๋กฌํํธ ์์ฑ ๋๋ ํ๋กฌํํธ ์ ์ฒ๋ฆฌ
auto_prompt = prompt
if not prompt or not prompt.strip():
if len(valid_images) == 1:
auto_prompt = "Please creatively transform this image into a more vivid and artistic version."
elif len(valid_images) == 2:
auto_prompt = "Please seamlessly composite these two images, integrating their key elements harmoniously into a single image."
else:
auto_prompt = "Please creatively composite these three images, combining their main elements into a cohesive and natural scene."
else:
auto_prompt = preprocess_prompt(prompt, image1, image2, image3)
# ์ด๋ฏธ์ง ์์ฑ ํจ์ ํธ์ถ
result_img, status = process_images_with_prompt(image1, image2, image3, prompt)
return result_img, status, auto_prompt
except Exception as e:
logger.exception("์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}", prompt
submit_btn.click(
fn=process_and_show_prompt,
inputs=[image1_input, image2_input, image3_input, prompt_input],
outputs=[output_image, output_text, prompt_display],
)
gr.Markdown(
"""
### ์ฌ์ฉ ๋ฐฉ๋ฒ:
1. **์๋ ํฉ์ฑ**: ์ด๋ฏธ์ง๋ง ์
๋ก๋ํ๊ณ ํ๋กฌํํธ๋ฅผ ๋น์๋๋ฉด ์๋์ผ๋ก ํฉ์ฑ๋ฉ๋๋ค.
2. **์ด๋ฏธ์ง ์ฐธ์กฐ**: #1, #2, #3์ผ๋ก ๊ฐ ์ด๋ฏธ์ง๋ฅผ ์ฐธ์กฐํ ์ ์์ต๋๋ค.
3. **์ผ๋ถ ์ด๋ฏธ์ง๋ง**: ํ์ํ ์ด๋ฏธ์ง๋ง ์
๋ก๋ํด๋ ๊ธฐ๋ฅ ์คํ์ด ๊ฐ๋ฅํฉ๋๋ค.
> **ํ**: ํ๋กฌํํธ๋ฅผ ์ง์ ์์ ํ ์๋ ์์ต๋๋ค.
"""
)
# ์ ํ๋ฆฌ์ผ์ด์
์คํ
if __name__ == "__main__":
demo.launch(share=True)
|