Spaces:
Running
on
Zero
Running
on
Zero
app.py
CHANGED
@@ -10,11 +10,6 @@ from datetime import datetime
|
|
10 |
from pytz import timezone
|
11 |
from scripts.survey import handle_form_submission, handle_visit_choice, handle_proceed, localize, script, generate_image, send_feedback
|
12 |
|
13 |
-
# 初期化
|
14 |
-
initialize(_use_local=False, use_gpu=True, use_dotenv=True)
|
15 |
-
init_model(use_local=False)
|
16 |
-
load_wd14_tagger_model()
|
17 |
-
|
18 |
def process_image(input_image, mode, weight1=None, weight2=None):
|
19 |
tokyo_time = datetime.now(timezone('Asia/Tokyo')).strftime("%Y-%m-%d %H:%M:%S") # 日本時間のタイムスタンプ
|
20 |
print(f"[{tokyo_time}] Processing image with mode={mode}, weight1={weight1}, weight2={weight2}")
|
@@ -212,4 +207,9 @@ with gr.Blocks() as demo:
|
|
212 |
# JavaScriptの読み込み
|
213 |
demo.load(None, None, None, js=script)
|
214 |
|
|
|
|
|
|
|
|
|
|
|
215 |
demo.launch()
|
|
|
10 |
from pytz import timezone
|
11 |
from scripts.survey import handle_form_submission, handle_visit_choice, handle_proceed, localize, script, generate_image, send_feedback
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
def process_image(input_image, mode, weight1=None, weight2=None):
|
14 |
tokyo_time = datetime.now(timezone('Asia/Tokyo')).strftime("%Y-%m-%d %H:%M:%S") # 日本時間のタイムスタンプ
|
15 |
print(f"[{tokyo_time}] Processing image with mode={mode}, weight1={weight1}, weight2={weight2}")
|
|
|
207 |
# JavaScriptの読み込み
|
208 |
demo.load(None, None, None, js=script)
|
209 |
|
210 |
+
# 初期化
|
211 |
+
initialize(_use_local=False, use_gpu=True, use_dotenv=True)
|
212 |
+
init_model(use_local=False)
|
213 |
+
load_wd14_tagger_model()
|
214 |
+
|
215 |
demo.launch()
|