Yuski commited on
Commit
2d3e2f6
·
verified ·
1 Parent(s): daa9c25

cancel log

Browse files
Files changed (1) hide show
  1. main.py +21 -21
main.py CHANGED
@@ -73,17 +73,17 @@ def gradio_multi_model_detection(
73
  global_datetime = datetime.now()
74
 
75
  #寫主表log
76
- document = {"log_style":"master",
77
- "create_datetime": str(global_datetime),
78
- "image_files": image_files,
79
- "model_files": model_files,
80
- "conf_threshold":conf_threshold,
81
- "enable_mllm":enable_mllm,
82
- "mllm_prompt":mllm_prompt,
83
- "enable_career_prediction":enable_career_prediction # 新增職業預測狀態到 log
84
- }
85
 
86
- #mongo.insert_mongodb_log("multi_model_detection",document) #寫入log方便日後查驗
87
 
88
  if not image_files:
89
  yield {
@@ -230,16 +230,16 @@ def gradio_multi_model_detection(
230
  all_result_files.append(str(output_career_prediction_txt_path))
231
 
232
  #寫明細表log
233
- document = {"log_style":"detail",
234
- "create_datetime": str(global_datetime),
235
- "image_path": str(image_path),
236
- "yolo_result": yolo_output_content,
237
- "enable_mllm": enable_mllm,
238
- "mllm_prompt": mllm_prompt,
239
- "mllm_result": mllm_result_content,
240
- "enable_career_prediction": enable_career_prediction, # 新增職業預測狀態到 log
241
- "career_prediction_result": career_prediction_result_content # 新增職業預測結果到 log
242
- }
243
 
244
  #mongo.insert_mongodb_log("multi_model_detection",document) #寫入log方便日後查驗
245
 
@@ -284,7 +284,7 @@ def toggle_career_prediction_checkbox(is_enabled):
284
  # --- Gradio Interface ---
285
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
286
  gr.Markdown("# ㊙️智慧影像與職業潛能分析 (YOLO + MLLM)")
287
- gr.Markdown("上傳圖片與YOLO模型進行物件偵測,並可選用MLLM進行進階圖像理解。 ver.250830.1")
288
  # mongo_uri = os.getenv('mongo_uri')
289
  # gr.Markdown(mongo_uri)
290
 
 
73
  global_datetime = datetime.now()
74
 
75
  #寫主表log
76
+ # document = {"log_style":"master",
77
+ # "create_datetime": str(global_datetime),
78
+ # "image_files": image_files,
79
+ # "model_files": model_files,
80
+ # "conf_threshold":conf_threshold,
81
+ # "enable_mllm":enable_mllm,
82
+ # "mllm_prompt":mllm_prompt,
83
+ # "enable_career_prediction":enable_career_prediction # 新增職業預測狀態到 log
84
+ # }
85
 
86
+ # mongo.insert_mongodb_log("multi_model_detection",document) #寫入log方便日後查驗
87
 
88
  if not image_files:
89
  yield {
 
230
  all_result_files.append(str(output_career_prediction_txt_path))
231
 
232
  #寫明細表log
233
+ # document = {"log_style":"detail",
234
+ # "create_datetime": str(global_datetime),
235
+ # "image_path": str(image_path),
236
+ # "yolo_result": yolo_output_content,
237
+ # "enable_mllm": enable_mllm,
238
+ # "mllm_prompt": mllm_prompt,
239
+ # "mllm_result": mllm_result_content,
240
+ # "enable_career_prediction": enable_career_prediction, # 新增職業預測狀態到 log
241
+ # "career_prediction_result": career_prediction_result_content # 新增職業預測結果到 log
242
+ # }
243
 
244
  #mongo.insert_mongodb_log("multi_model_detection",document) #寫入log方便日後查驗
245
 
 
284
  # --- Gradio Interface ---
285
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
286
  gr.Markdown("# ㊙️智慧影像與職業潛能分析 (YOLO + MLLM)")
287
+ gr.Markdown("上傳圖片與YOLO模型進行物件偵測,並可選用MLLM進行進階圖像理解。 ver.250901.1")
288
  # mongo_uri = os.getenv('mongo_uri')
289
  # gr.Markdown(mongo_uri)
290