2025-04-11 08:54:28 +08:00
|
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
|
from sqlalchemy import String, Integer, JSON
|
|
|
|
|
|
|
|
|
|
from db.db_base import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectInfo(BaseModel):
|
|
|
|
|
"""
|
|
|
|
|
项目信息表
|
|
|
|
|
"""
|
|
|
|
|
__tablename__ = "project_info"
|
|
|
|
|
__table_args__ = ({'comment': '项目类别表 - 标识项目的类型目前存在的(目标识别,OCR识别,瑕疵检测,图像分类)'})
|
|
|
|
|
|
|
|
|
|
project_no: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
|
|
|
|
|
project_name: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
|
|
|
|
|
type_code: Mapped[str] = mapped_column(String(10))
|
|
|
|
|
description: Mapped[str] = mapped_column(String(255))
|
|
|
|
|
project_status: Mapped[str] = mapped_column(String(10))
|
|
|
|
|
user_id: Mapped[int] = mapped_column(Integer)
|
|
|
|
|
dept_id: Mapped[int] = mapped_column(Integer)
|
|
|
|
|
train_version: Mapped[int] = mapped_column(Integer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectLabel(BaseModel):
|
|
|
|
|
"""
|
|
|
|
|
项目标签表
|
|
|
|
|
"""
|
|
|
|
|
__tablename__ = "project_label"
|
|
|
|
|
__table_args__ = ({'comment': '项目标签表'})
|
|
|
|
|
|
|
|
|
|
label_name: Mapped[str] = mapped_column(String(32), unique=True, nullable=False)
|
|
|
|
|
project_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
|
|
|
meta: Mapped[dict] = mapped_column(JSON)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectImage(BaseModel):
|
|
|
|
|
"""
|
|
|
|
|
项目图片表
|
|
|
|
|
"""
|
|
|
|
|
__tablename__ = "project_image"
|
|
|
|
|
__table_args__ = ({'comment': '项目图片表'})
|
|
|
|
|
|
|
|
|
|
img_type: Mapped[str] = mapped_column(String(10))
|
|
|
|
|
file_name: Mapped[str] = mapped_column(String(64), nullable=False)
|
|
|
|
|
image_url: Mapped[str] = mapped_column(String(255), nullable=False)
|
2025-04-11 14:30:48 +08:00
|
|
|
|
object_key: Mapped[str] = mapped_column(String(255), nullable=False)
|
2025-04-11 08:54:28 +08:00
|
|
|
|
thumb_image_url: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
|
|
|
project_id: Mapped[int] = mapped_column(Integer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectImgLeafer(BaseModel):
|
|
|
|
|
"""
|
|
|
|
|
项目图片leafer表
|
|
|
|
|
"""
|
|
|
|
|
__tablename__ = "project_img_leafer"
|
|
|
|
|
__table_args__ = ({'comment': '项目图片leafer表'})
|
|
|
|
|
|
|
|
|
|
image_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
|
|
|
leafer: Mapped[dict] = mapped_column(JSON)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectImgLabel(BaseModel):
|
|
|
|
|
"""
|
|
|
|
|
项目图片标签对应表,一张图片对应多个label
|
|
|
|
|
"""
|
|
|
|
|
__tablename__ = "project_img_label"
|
|
|
|
|
__table_args__ = ({'comment': '项目图片标签对应表,一张图片对应多个label'})
|
|
|
|
|
|
|
|
|
|
image_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
|
|
|
label_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
|
|
|
mark_center_x: Mapped[str] = mapped_column(String(64), nullable=False)
|
|
|
|
|
mark_center_y: Mapped[str] = mapped_column(String(64), nullable=False)
|
|
|
|
|
mark_width: Mapped[str] = mapped_column(String(64), nullable=False)
|
|
|
|
|
mark_height: Mapped[str] = mapped_column(String(64), nullable=False)
|