修改配置文件
This commit is contained in:
@@ -71,7 +71,7 @@ class EmbeddingFoodClassifierApp:
|
|||||||
# model_path = os.path.join(BASE_DIR, "../model/ProcessedIngredientRecognition/embedding_20251029_170904/best_embedding_model.pth")
|
# model_path = os.path.join(BASE_DIR, "../model/ProcessedIngredientRecognition/embedding_20251029_170904/best_embedding_model.pth")
|
||||||
# model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/cosface_20251106_134718/best_cosface_model.pth")
|
# model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/cosface_20251106_134718/best_cosface_model.pth")
|
||||||
# model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/grid_search_20251204_140816/model_s64.0_m0.4.pth")
|
# model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/grid_search_20251204_140816/model_s64.0_m0.4.pth")
|
||||||
model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/grid_search_20260302_182102/best_model_s60.0_m0.42.pth")
|
model_path = os.path.join(BASE_DIR, "../model/WholeIngredientRecognition/grid_search_20260325_195636/best_model_s64.0_m0.45.pth")
|
||||||
# model_path = os.path.join(BASE_DIR, "../model/DishClassification/cosface_20251111_153649/best_cosface_model.pth")
|
# model_path = os.path.join(BASE_DIR, "../model/DishClassification/cosface_20251111_153649/best_cosface_model.pth")
|
||||||
|
|
||||||
# FAISS索引目录
|
# FAISS索引目录
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ TABLE_MAPPING = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ======================== 图片URL前缀 ========================
|
# ======================== 图片URL前缀 ========================
|
||||||
IMAGE_URL_PREFIX = 'https://dev.yixiong-tech.com:8081'
|
IMAGE_URL_PREFIX = 'https://dev.yixiong-tech.com:8082'
|
||||||
|
|
||||||
# ======================== SQLite下载历史数据库 ========================
|
# ======================== SQLite下载历史数据库 ========================
|
||||||
# 存储在项目的data_management目录下
|
# 存储在项目的data_management目录下
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ if __name__ == "__main__":
|
|||||||
help='输出 txt 文件路径(可选)'
|
help='输出 txt 文件路径(可选)'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--excel', action='store_true',
|
'--excel', action='store_true',default= '--excel',
|
||||||
help='是否同时导出 Excel 文件(可直接复制粘贴到飞书云文档)'
|
help='是否同时导出 Excel 文件(可直接复制粘贴到飞书云文档)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ def main():
|
|||||||
#grid_search最佳模型 s=68, m=0.42 1.22
|
#grid_search最佳模型 s=68, m=0.42 1.22
|
||||||
# MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260122_112545/best_model_s68.0_m0.42.pth"
|
# MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260122_112545/best_model_s68.0_m0.42.pth"
|
||||||
# MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260302_092600/best_model_s64.0_m0.4.pth"
|
# MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260302_092600/best_model_s64.0_m0.4.pth"
|
||||||
MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260302_182102/best_model_s60.0_m0.42.pth"
|
MODEL_PATH = "../model/WholeIngredientRecognition/grid_search_20260325_195636/best_model_s64.0_m0.45.pth"
|
||||||
# MODEL_PATH = "../model/DishClassification/grid_search_20251121_102723/model_s56.0_m0.4.pth"
|
# MODEL_PATH = "../model/DishClassification/grid_search_20251121_102723/model_s56.0_m0.4.pth"
|
||||||
# MODEL_PATH = "../model/DishClassification/cosface_20251111_153649/best_cosface_model.pth"
|
# MODEL_PATH = "../model/DishClassification/cosface_20251111_153649/best_cosface_model.pth"
|
||||||
# TRAIN_DIR = "../dataset/ProcessedIngredientRecognition/train"
|
# TRAIN_DIR = "../dataset/ProcessedIngredientRecognition/train"
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
"""
|
||||||
|
现在基本上不用这个脚本,这个是早期的,现在用toAndroidEmbedding.py
|
||||||
|
"""
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from net import create_food_cnn, create_mobile_food_cnn
|
from net import create_food_cnn, create_mobile_food_cnn
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def main():
|
|||||||
base_model = create_mobile_resnet50_embedding(embedding_dim=512, pretrained=True)
|
base_model = create_mobile_resnet50_embedding(embedding_dim=512, pretrained=True)
|
||||||
# model_path = "../model/DishClassification/grid_search_20251121_102723/model_s56.0_m0.4.pth"
|
# model_path = "../model/DishClassification/grid_search_20251121_102723/model_s56.0_m0.4.pth"
|
||||||
# model_path = "../model/WholeIngredientRecognition/cosface_20251106_134718/best_cosface_model.pth"
|
# model_path = "../model/WholeIngredientRecognition/cosface_20251106_134718/best_cosface_model.pth"
|
||||||
model_path = "../model/WholeIngredientRecognition/grid_search_20260302_182102/best_model_s60.0_m0.42.pth"
|
model_path = "../model/WholeIngredientRecognition/grid_search_20260325_195636/best_model_s64.0_m0.45.pth"
|
||||||
# model_path = "../model/WholeIngredientRecognition/cosface_20260121_133207/best_cosface_model.pth"
|
# model_path = "../model/WholeIngredientRecognition/cosface_20260121_133207/best_cosface_model.pth"
|
||||||
# model_path = "../model/ProcessedIngredientRecognition/embedding_20251029_173607/best_embedding_model.pth"
|
# model_path = "../model/ProcessedIngredientRecognition/embedding_20251029_173607/best_embedding_model.pth"
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ def main():
|
|||||||
# 保存模型,一定不要乱改,防止模型覆盖!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
# 保存模型,一定不要乱改,防止模型覆盖!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
# output_path = "../model/DishClassification/grid_search_20251121_102723/best_embedding_model_mobile.pt"
|
# output_path = "../model/DishClassification/grid_search_20251121_102723/best_embedding_model_mobile.pt"
|
||||||
#原本路径
|
#原本路径
|
||||||
output_path = "../model/WholeIngredientRecognition/grid_search_20260302_182102/best_embedding_model_mobile.pt"
|
output_path = "../model/WholeIngredientRecognition/grid_search_20260325_195636/best_embedding_model_mobile.pt"
|
||||||
#新路径
|
#新路径
|
||||||
# output_path = "../model/WholeIngredientRecognition/cosface_20260121_133207/best_cosface_model_mobile.pt"
|
# output_path = "../model/WholeIngredientRecognition/cosface_20260121_133207/best_cosface_model_mobile.pt"
|
||||||
# output_path = "../model/WholeIngredientRecognition/cosface_20251106_134718/best_embedding_model_mobile.pt"
|
# output_path = "../model/WholeIngredientRecognition/cosface_20251106_134718/best_embedding_model_mobile.pt"
|
||||||
|
|||||||
Reference in New Issue
Block a user