增加一些设置。

This commit is contained in:
2025-10-17 18:24:04 +08:00
parent 25f8e0a267
commit 5db96600fe
10 changed files with 38 additions and 25 deletions
+8 -4
View File
@@ -64,12 +64,16 @@ class EmbeddingFoodClassifierApp:
# 获取当前脚本所在目录
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# model_path = "../model/embedding_20251011_133653/best_embedding_model.pth"
model_path = os.path.join(BASE_DIR, "../model/embedding_20251011_133653/best_embedding_model.pth")
# model_path = os.path.join(BASE_DIR, "../model/embedding_20251011_133653/best_embedding_model.pth")
model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/embedding_20251017_145836/best_embedding_model.pth")
# model_path = os.path.join(BASE_DIR, "../model/DishClassification/embedding_20251011_133653/best_embedding_model.pth")
# FAISS索引目录
# index_dir = "../faiss_vector_db/faiss_index"
index_dir = os.path.join(BASE_DIR, "../faiss_vector_db/faiss_index")
# index_dir = os.path.join(BASE_DIR, "../faiss_vector_db/faiss_index")
index_dir = os.path.join(BASE_DIR, "../faiss_vector_db/WholeIngredientRecognition/faiss_index")
# index_dir = os.path.join(BASE_DIR, "../faiss_vector_db/DishClassification/faiss_index")
if os.path.exists(model_path) and os.path.exists(index_dir):
# 1. 加载embedding模型
print("正在加载embedding模型...")