From a14aa7f8e1c5e76da7f6313d31ba425ba249708c Mon Sep 17 00:00:00 2001 From: zhangpu <1250681871@qq.com> Date: Thu, 9 Oct 2025 09:59:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + classifier/embedding_food_classifier_app.py | 2 +- data_expansion/data_expansion.py | 2 +- faiss_vector_db/build_faiss_index.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d164478..b3fe3d2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /model/ /faiss_vector_db/demo_faiss_index/ /faiss_vector_db/faiss_index/ +/faiss_vector_db/faiss_index092901/ diff --git a/classifier/embedding_food_classifier_app.py b/classifier/embedding_food_classifier_app.py index 0c2a044..cce0efb 100644 --- a/classifier/embedding_food_classifier_app.py +++ b/classifier/embedding_food_classifier_app.py @@ -61,7 +61,7 @@ class EmbeddingFoodClassifierApp: """加载训练好的embedding模型和FAISS索引""" try: # 模型路径 - model_path = "../model/embedding_20250929_151102/best_embedding_model.pth" + model_path = "../model/embedding_20250930_102826/best_embedding_model.pth" # FAISS索引目录 index_dir = "../faiss_vector_db/faiss_index" diff --git a/data_expansion/data_expansion.py b/data_expansion/data_expansion.py index 9b75a9a..052e561 100644 --- a/data_expansion/data_expansion.py +++ b/data_expansion/data_expansion.py @@ -27,7 +27,7 @@ for class_name in os.listdir(input_root): input_dir = os.path.join(input_root, class_name) output_dir = os.path.join(output_root, class_name) os.makedirs(output_dir, exist_ok=True) - if class_name == "麻婆豆腐": + if class_name == "肉沫酸豆角": # 读取类别下所有图片路径 img_files = [f for f in os.listdir(input_dir) if f.lower().endswith(('.jpg', '.png', '.jpeg'))] img_paths = [os.path.join(input_dir, f) for f in img_files] diff --git a/faiss_vector_db/build_faiss_index.py b/faiss_vector_db/build_faiss_index.py index cd65899..5c1abaf 100644 --- a/faiss_vector_db/build_faiss_index.py +++ b/faiss_vector_db/build_faiss_index.py @@ -477,7 +477,7 @@ class FAISSSearcher: def main(): """主函数""" # 配置参数 - MODEL_PATH = "../model/embedding_20250929_151102/best_embedding_model.pth" + MODEL_PATH = "../model/embedding_20250930_102826/best_embedding_model.pth" TRAIN_DIR = "../dataset/train" OUTPUT_DIR = "faiss_index" BATCH_SIZE = 16