settings.py中增加推理模型路径。
This commit is contained in:
@@ -14,6 +14,7 @@ from tkinterdnd2 import DND_FILES, TkinterDnD
|
||||
import threading
|
||||
import time
|
||||
from net import create_food_cnn
|
||||
from settings import settings
|
||||
|
||||
# 设置customtkinter的外观
|
||||
ctk.set_appearance_mode("System")
|
||||
@@ -54,7 +55,7 @@ class FoodClassifierApp:
|
||||
def load_model(self):
|
||||
"""加载训练好的PyTorch模型"""
|
||||
try:
|
||||
model_path = "../model/02/best_food_model.pth"
|
||||
model_path = settings.INFERENCE_BEST_MODEL_PATH
|
||||
if os.path.exists(model_path):
|
||||
# 创建模型实例
|
||||
self.model = create_food_cnn()
|
||||
|
||||
Reference in New Issue
Block a user