上线部署
parent
4dd77023a2
commit
94e1c48d63
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() 方法,使用自定义绘制")
|
||||
|
|
|
|||
Loading…
Reference in New Issue