主题功能完成
This commit is contained in:
@ -153,13 +153,19 @@ def get_img_leafer(image_id: int, session: Session = Depends(get_db)):
|
||||
|
||||
|
||||
@project.get("/run_train/{project_id}")
|
||||
def run_train(project_id: int, session: Session = Depends(get_db)):
|
||||
async def run_train(project_id: int, session: Session = Depends(get_db)):
|
||||
"""
|
||||
执行项目训练方法
|
||||
:param project_id:
|
||||
:param session:
|
||||
:return:
|
||||
"""
|
||||
project_info = pic.get_project_by_id(project_id, session)
|
||||
if project_info is None:
|
||||
return rc.response_error("项目查询错误")
|
||||
if project_info.project_status == '1':
|
||||
return rc.response_error("项目当前存在训练进程,请稍后再试")
|
||||
data, project, name, epochs, yolo_path, version_path = ps.run_train_yolo(project_info, session)
|
||||
data, project_name, name = ps.run_train_yolo(project_info, session)
|
||||
return StreamingResponse(
|
||||
ps.run_commend(data, project, name, epochs, yolo_path, version_path, project_id, session),
|
||||
ps.run_commend(data, project_name, name, 10, project_id, session),
|
||||
media_type="text/plain")
|
||||
|
Reference in New Issue
Block a user