2025-08-02 12:38:52 +08:00

19 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from sqlalchemy import Column, String, Text, Boolean, Float, Integer
from .base import BaseModel
class Algorithm(BaseModel):
__tablename__ = "algorithms"
name = Column(String(100), nullable=False, comment="算法名称")
description = Column(Text, comment="算法描述")
version = Column(String(20), nullable=False, comment="算法版本")
model_path = Column(String(255), comment="模型文件路径")
config_path = Column(String(255), comment="配置文件路径")
status = Column(String(20), default="inactive", comment="算法状态: active, inactive, training")
accuracy = Column(Float, comment="算法准确率")
detection_classes = Column(Text, comment="检测类别JSON格式")
input_size = Column(String(20), comment="输入尺寸,如: 640x640")
inference_time = Column(Float, comment="推理时间(ms)")
is_enabled = Column(Boolean, default=True, comment="是否启用")
creator = Column(String(50), comment="创建者")
tags = Column(Text, comment="标签JSON格式")