leon il y a 1 mois
Parent
commit
04acb1b640
2 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 0
      src/infer/trt/depth/depth.cu
  2. 0 2
      src/nodes/infer/inferNode.cpp

+ 1 - 0
src/infer/trt/depth/depth.cu

@@ -90,6 +90,7 @@ Result DepthModelImpl::forward(const tensor::Image &image, int slice_width, int
 
 Result DepthModelImpl::forward(const tensor::Image &image, void *stream)
 {
+    std::lock_guard<std::mutex> lock(mutex_); // 自动加锁/解锁
     int num_image = 1;
     if (num_image == 0) return {};
     

+ 0 - 2
src/nodes/infer/inferNode.cpp

@@ -54,8 +54,6 @@ void InferNode::work()
                 {
                     metaData->boxes.push_back(r);
                 }
-                metaData->boxes = result;
-                // 处理检测框...
             } 
             else if(std::holds_alternative<cv::Mat>(det_result))
             {