| 12345678910111213141516171819202122232425262728293031 |
- import os
- class Settings:
- PROJECT_NAME = "Pokemon Card Search"
- # 路径配置
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
- STATIC_DIR = os.path.join(BASE_DIR, "app", "static")
- IMAGE_STORAGE_DIR = os.path.join(STATIC_DIR, "images")
- TEMP_UPLOAD_DIR = os.path.join(BASE_DIR, "uploads")
- # 模型路径
- YOLO_MODEL_PATH = "/home/martin/ML/Model/card_cls/yolov11n_card_seg01.onnx"
- VIT_MODEL_PATH = "/home/martin/ML/Model/pokemon_cls/vit-base-patch16-224-Pokemon03"
- # Milvus 配置
- MILVUS_HOST = "127.0.0.1"
- MILVUS_PORT = "19530"
- COLLECTION_NAME = "pokemon_cards"
- VECTOR_DIM = 768 # ViT Base 通常是 768
- # 批处理大小
- BATCH_SIZE = 32
- def __init__(self):
- os.makedirs(self.IMAGE_STORAGE_DIR, exist_ok=True)
- os.makedirs(self.TEMP_UPLOAD_DIR, exist_ok=True)
- settings = Settings()
|