改进项目结构
This commit is contained in:
@ -118,7 +118,7 @@ def run_detect_yolo(detect_log_in: ProjectDetectLogIn, session: Session = Depend
|
||||
if train is None:
|
||||
return rc.response_error("训练权重不存在")
|
||||
detect_img_count = pdc.check_detect_img(detect_log_in.detect_id, session)
|
||||
if detect_img_count == 0:
|
||||
if detect_img_count == 0 and detect.rtsp_url is None:
|
||||
return rc.response_error("推理集合中没有内容,请先到推理集合中上传图片")
|
||||
if detect.file_type == 'img' or detect.file_type == 'video':
|
||||
detect_log = pds.run_detect_yolo(detect_log_in, detect, train, session)
|
||||
@ -131,8 +131,8 @@ def run_detect_yolo(detect_log_in: ProjectDetectLogIn, session: Session = Depend
|
||||
weights_pt = train.best_pt
|
||||
else:
|
||||
weights_pt = train.last_pt
|
||||
thread_train = threading.Thread(target=pds.run_detect_rtsp,
|
||||
args=(weights_pt, detect.rtsp_url, train.train_data,))
|
||||
thread_train = threading.Thread(target=run_rtsp_loop,
|
||||
args=(weights_pt, detect.rtsp_url, train.train_data, detect.id))
|
||||
thread_train.start()
|
||||
return rc.response_success(msg="执行成功")
|
||||
|
||||
|
Reference in New Issue
Block a user