完成推理模块的转移
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from .project_detect import ProjectDetect, ProjectDetectSimpleOut
|
||||
from .project_detect_img import ProjectDetectImg, ProjectDetectImgSimpleOut
|
||||
from .project_detect_log import ProjectDetectLog, ProjectDetectLogSimpleOut
|
||||
from .project_detect_log_img import ProjectDetectLogImg, ProjectDetectLogImgSimpleOut
|
||||
from .project_detect import ProjectDetectIn, ProjectDetectPager, ProjectDetectOut, ProjectDetectList
|
||||
from .project_detect_file import ProjectDetectFilePager, ProjectDetectFileOut
|
||||
from .project_detect_log import ProjectDetectLogIn, ProjectDetectLogOut
|
||||
from .project_detect_log_file import ProjectDetectLogFileOut
|
||||
|
@ -7,24 +7,43 @@
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from core.data_types import DatetimeStr
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ProjectDetect(BaseModel):
|
||||
project_id: int = Field(..., title="None")
|
||||
detect_name: str = Field(..., title="None")
|
||||
detect_version: int = Field(..., title="None")
|
||||
detect_no: str = Field(..., title="None")
|
||||
detect_status: int = Field(..., title="None")
|
||||
file_type: str = Field(..., title="None")
|
||||
folder_url: str = Field(..., title="None")
|
||||
rtsp_url: str = Field(..., title="None")
|
||||
user_id: int = Field(..., title="None")
|
||||
class ProjectDetectIn(BaseModel):
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
file_type: Optional[str] = Field('img', description="推理集合文件类别")
|
||||
detect_name: Optional[str] = Field(..., description="推理集合名称")
|
||||
rtsp_url: Optional[str] = Field(None, description="视频流地址")
|
||||
|
||||
|
||||
class ProjectDetectSimpleOut(ProjectDetect):
|
||||
class ProjectDetectPager(BaseModel):
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
detect_name: Optional[str] = Field(None, description="推理集合名称")
|
||||
pagerNum: Optional[int] = Field(1, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(10, description="每页数量")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int = Field(..., title="编号")
|
||||
create_datetime: DatetimeStr = Field(..., title="创建时间")
|
||||
update_datetime: DatetimeStr = Field(..., title="更新时间")
|
||||
|
||||
class ProjectDetectOut(BaseModel):
|
||||
id: Optional[int]
|
||||
project_id: Optional[int]
|
||||
detect_name: Optional[str]
|
||||
detect_no: Optional[str]
|
||||
detect_version: Optional[int]
|
||||
file_type: Optional[str]
|
||||
folder_url: Optional[str]
|
||||
rtsp_url: Optional[str]
|
||||
create_time: Optional[datetime]
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ProjectDetectList(BaseModel):
|
||||
id: Optional[int]
|
||||
file_type: Optional[str]
|
||||
detect_name: Optional[str]
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
26
apps/business/detect/schemas/project_detect_file.py
Normal file
26
apps/business/detect/schemas/project_detect_file.py
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:30
|
||||
# @File : project_detect_file.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ProjectDetectFilePager(BaseModel):
|
||||
detect_id: Optional[int] = Field(..., description="训练集合id")
|
||||
pagerNum: Optional[int] = Field(None, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(None, description="每页数量")
|
||||
|
||||
|
||||
class ProjectDetectFileOut(BaseModel):
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
detect_id: Optional[int] = Field(..., description="训练集合id")
|
||||
file_name: Optional[str] = Field(None, description="文件名称")
|
||||
thumb_file_url: Optional[str] = Field(None, description="文件路径")
|
||||
create_time: Optional[datetime] = Field(None, description="上传时间")
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
@ -1,26 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:30
|
||||
# @File : project_detect_img.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from core.data_types import DatetimeStr
|
||||
|
||||
|
||||
class ProjectDetectImg(BaseModel):
|
||||
detect_id: int = Field(..., title="None")
|
||||
file_name: str = Field(..., title="None")
|
||||
image_url: str = Field(..., title="None")
|
||||
thumb_image_url: str = Field(..., title="None")
|
||||
user_id: int = Field(..., title="None")
|
||||
|
||||
|
||||
class ProjectDetectImgSimpleOut(ProjectDetectImg):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int = Field(..., title="编号")
|
||||
create_datetime: DatetimeStr = Field(..., title="创建时间")
|
||||
update_datetime: DatetimeStr = Field(..., title="更新时间")
|
@ -7,25 +7,24 @@
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from core.data_types import DatetimeStr
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ProjectDetectLog(BaseModel):
|
||||
detect_id: int = Field(..., title="None")
|
||||
detect_version: str = Field(..., title="None")
|
||||
detect_name: str = Field(..., title="None")
|
||||
train_id: int = Field(..., title="None")
|
||||
train_version: str = Field(..., title="None")
|
||||
pt_type: str = Field(..., title="None")
|
||||
pt_url: str = Field(..., title="None")
|
||||
folder_url: str = Field(..., title="None")
|
||||
detect_folder_url: str = Field(..., title="None")
|
||||
user_id: int = Field(..., title="None")
|
||||
class ProjectDetectLogIn(BaseModel):
|
||||
detect_id: Optional[int] = Field(..., description="推理集合id")
|
||||
train_id: Optional[int] = Field(..., description="训练结果id")
|
||||
pt_type: Optional[str] = Field('best', description="权重文件类型")
|
||||
|
||||
|
||||
class ProjectDetectLogSimpleOut(ProjectDetectLog):
|
||||
class ProjectDetectLogOut(BaseModel):
|
||||
id: Optional[int]
|
||||
detect_id: Optional[int]
|
||||
detect_version: Optional[str]
|
||||
detect_name: Optional[str]
|
||||
train_id: Optional[int]
|
||||
train_version: Optional[str]
|
||||
pt_type: Optional[str]
|
||||
create_time: Optional[datetime]
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int = Field(..., title="编号")
|
||||
create_datetime: DatetimeStr = Field(..., title="创建时间")
|
||||
update_datetime: DatetimeStr = Field(..., title="更新时间")
|
||||
|
20
apps/business/detect/schemas/project_detect_log_file.py
Normal file
20
apps/business/detect/schemas/project_detect_log_file.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:31
|
||||
# @File : project_detect_log_file.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ProjectDetectLogFileOut(BaseModel):
|
||||
id: Optional[int]
|
||||
file_name: Optional[str]
|
||||
thumb_file_url: Optional[str]
|
||||
create_time: Optional[datetime]
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @version : 1.0
|
||||
# @Create Time : 2025/04/03 10:31
|
||||
# @File : project_detect_log_img.py
|
||||
# @IDE : PyCharm
|
||||
# @desc : pydantic 模型,用于数据库序列化操作
|
||||
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from core.data_types import DatetimeStr
|
||||
|
||||
|
||||
class ProjectDetectLogImg(BaseModel):
|
||||
log_id: int = Field(..., title="None")
|
||||
file_name: str = Field(..., title="None")
|
||||
image_url: str = Field(..., title="None")
|
||||
|
||||
|
||||
class ProjectDetectLogImgSimpleOut(ProjectDetectLogImg):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int = Field(..., title="编号")
|
||||
create_datetime: DatetimeStr = Field(..., title="创建时间")
|
||||
update_datetime: DatetimeStr = Field(..., title="更新时间")
|
Reference in New Issue
Block a user