Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,33 @@
|
|
6 |
import gradio as gr
|
7 |
import json
|
8 |
import tempfile
|
|
|
|
|
9 |
from datetime import datetime
|
10 |
from PIL import Image
|
11 |
from typing import Dict, List, Any, Optional
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
class EventGeneratorApp:
|
20 |
"""이벤트 생성기 메인 애플리케이션"""
|
|
|
6 |
import gradio as gr
|
7 |
import json
|
8 |
import tempfile
|
9 |
+
import sys
|
10 |
+
import os
|
11 |
from datetime import datetime
|
12 |
from PIL import Image
|
13 |
from typing import Dict, List, Any, Optional
|
14 |
|
15 |
+
# 현재 디렉토리를 Python 경로에 추가
|
16 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
17 |
+
sys.path.append(current_dir)
|
18 |
+
|
19 |
+
# 모듈 import (절대 경로로 수정)
|
20 |
+
try:
|
21 |
+
from modules.ai_analyzer import MonthlyConceptAnalyzer, EventNoticeGenerator
|
22 |
+
from modules.image_analyzer import ImageAnalyzer, format_image_analysis_result
|
23 |
+
from modules.design_guide import DesignGuideGenerator
|
24 |
+
from modules.utils import EventUtils, ValidationUtils, TextUtils
|
25 |
+
except ImportError:
|
26 |
+
# modules 폴더가 없는 경우 직접 정의된 클래스들 사용
|
27 |
+
import warnings
|
28 |
+
warnings.warn("modules 폴더를 찾을 수 없습니다. 내장 클래스를 사용합니다.")
|
29 |
+
|
30 |
+
# 필요한 클래스들을 여기에 직접 정의
|
31 |
+
from datetime import datetime
|
32 |
+
import random
|
33 |
+
import cv2
|
34 |
+
import numpy as np
|
35 |
+
from sklearn.cluster import KMeans
|
36 |
|
37 |
class EventGeneratorApp:
|
38 |
"""이벤트 생성기 메인 애플리케이션"""
|