修改一些小问题
This commit is contained in:
@ -88,7 +88,6 @@ def del_img(image_id: int, session: Session):
|
||||
session.commit()
|
||||
|
||||
|
||||
|
||||
def save_img_label(img_leafer_label: ProjectImgLeaferLabel, session: Session):
|
||||
"""
|
||||
保存图片的标签框选信息,每次保存都会针对图片的信息全部删除,然后重新保存
|
||||
@ -223,7 +222,7 @@ async def run_commend(data: str, project: str, name: str, epochs: int, patience:
|
||||
while process.poll() is None:
|
||||
line = process.stdout.readline()
|
||||
process.stdout.flush() # 刷新缓存,防止缓存过多造成卡死
|
||||
if line != '\n' and '0%' not in line:
|
||||
if line != '\n' and '0%' not in line and 'yolo' not in line and 'YOLO' not in line:
|
||||
await room_manager.send_to_room(room, line + '\n')
|
||||
|
||||
# 等待进程结束并获取返回码
|
||||
@ -232,24 +231,24 @@ async def run_commend(data: str, project: str, name: str, epochs: int, patience:
|
||||
pic.update_project_status(project_id, '-1', session)
|
||||
else:
|
||||
await room_manager.send_to_room(room, 'success')
|
||||
pic.update_project_status(project_id, '2', session)
|
||||
# 然后保存版本训练信息
|
||||
train = ProjectTrain()
|
||||
train.project_id = project_id
|
||||
train.train_version = name
|
||||
train_url = os.file_path(project, name)
|
||||
train.train_url = train_url
|
||||
train.train_data = data
|
||||
bast_pt_path = os.file_path(train_url, 'weights', 'best.pt')
|
||||
last_pt_path = os.file_path(train_url, 'weights', 'last.pt')
|
||||
train.best_pt = bast_pt_path
|
||||
train.last_pt = last_pt_path
|
||||
if weights != None and weights != '':
|
||||
train.weights_id = weights
|
||||
train.weights_name = train_info.train_version
|
||||
train.patience = patience
|
||||
train.epochs = epochs
|
||||
ptc.add_train(train, session)
|
||||
pic.update_project_status(project_id, '2', session)
|
||||
# 然后保存版本训练信息
|
||||
train = ProjectTrain()
|
||||
train.project_id = project_id
|
||||
train.train_version = name
|
||||
train_url = os.file_path(project, name)
|
||||
train.train_url = train_url
|
||||
train.train_data = data
|
||||
bast_pt_path = os.file_path(train_url, 'weights', 'best.pt')
|
||||
last_pt_path = os.file_path(train_url, 'weights', 'last.pt')
|
||||
train.best_pt = bast_pt_path
|
||||
train.last_pt = last_pt_path
|
||||
if weights != None and weights != '':
|
||||
train.weights_id = weights
|
||||
train.weights_name = train_info.train_version
|
||||
train.patience = patience
|
||||
train.epochs = epochs
|
||||
ptc.add_train(train, session)
|
||||
|
||||
|
||||
def operate_img_label(img_list: List[ProjectImgLabel],
|
||||
|
Reference in New Issue
Block a user