上线部署

main
石超 2025-12-16 10:58:30 +08:00
parent 4dd77023a2
commit 94e1c48d63
2 changed files with 3 additions and 3 deletions

View File

@ -1142,7 +1142,9 @@ class DetectionThread(threading.Thread):
self.frame_count += 1
continue
# 多模型推理
start = time.time()
annotated_frame, model_detections = self._multi_model_inference(frame)
logger.info(f'startTime:{start},endTime:{time.time()},时间差:{time.time() - start}')
# 推流处理Windows优化
if self.enable_push:
if not self.push_frame_to_task_streamer(annotated_frame):
@ -1151,9 +1153,7 @@ class DetectionThread(threading.Thread):
if current_time - self.last_log_time >= 1:
# # WebSocket发送
start = time.time()
self.send_to_websocket(model_detections)
logger.info(f'startTime:{start},endTime:{time.time()},时间差:{time.time()-start}')
# # 上传处理
# self.handle_upload(annotated_frame, model_detections, current_time)
self.last_log_time = current_time

View File

@ -421,7 +421,7 @@ def multi_model_inference(
# plot方法通常返回RGB图像转换为BGR
if len(frame_drawn.shape) == 3 and frame_drawn.shape[2] == 3:
frame_drawn = cv2.cvtColor(frame_drawn, cv2.COLOR_RGB2BGR)
print(f"使用 {single_detection.model_name} 的 plot() 方法绘制结果")
# print(f"使用 {single_detection.model_name} 的 plot() 方法绘制结果")
return frame_drawn, detections
else:
print(f"模型 {single_detection.model_name} 的结果对象没有 plot() 方法,使用自定义绘制")