leon hai 1 mes
pai
achega
66ae15addf

+ 2 - 1
.vscode/settings.json

@@ -59,6 +59,7 @@
         "fstream": "cpp",
         "iterator": "cpp",
         "utility": "cpp",
-        "chrono": "cpp"
+        "chrono": "cpp",
+        "set": "cpp"
     }
 }

+ 2 - 1
Makefile

@@ -25,7 +25,8 @@ include_paths        := $(project_include_path) \
 						$(trt_include_path) \
 						$(cuda_include_path) \
 						$(python_include_path) \
-						$(bt_include_path)
+						$(bt_include_path) \
+						$(eigen3_include_path)
 
 
 opencv_library_path  := /workspace/compile/__install/opencv490/lib/

+ 0 - 1
src/common/utils.cpp

@@ -3,7 +3,6 @@
 #include <iomanip>
 #include <sstream>
 
-#include "ByteTrack.h"
 #include "common/data.hpp"
 
 std::string getTimeString()

+ 7 - 5
src/main.cpp

@@ -2,6 +2,7 @@
 #include "nodes/stream/streamNode.hpp"
 #include "nodes/infer/inferNode.hpp"
 #include "nodes/draw/drawNode.hpp"
+#include "nodes/track/trackNode.hpp"
 #include "nodes/httpPush/httpPush.hpp"
 
 
@@ -37,14 +38,18 @@ void test_yolo()
     std::shared_ptr<Node::InferNode> infer_node   = std::make_shared<Node::InferNode>("yolo11");
     infer_node->set_model_instance(yolo_model, ModelType::YOLO11);
 
+    std::shared_ptr<Node::TrackNode> track_node     = std::make_shared<Node::TrackNode>("tracker", 30, 30);
+
     std::shared_ptr<Node::DrawNode> draw_node     = std::make_shared<Node::DrawNode>("draw");
     std::shared_ptr<Node::HttpPushNode> push_node = std::make_shared<Node::HttpPushNode>("push", "172.16.20.168", 8080, "/push");
     
     Node::LinkNode(src_node0, infer_node);
-    Node::LinkNode(infer_node, draw_node);
+    Node::LinkNode(infer_node, track_node);
+    Node::LinkNode(track_node, draw_node);
     Node::LinkNode(draw_node, push_node);
     push_node->start();
     draw_node->start();
+    track_node->start();
     infer_node->start();
     src_node0->start();
     getchar();
@@ -92,7 +97,7 @@ void test_multi()
 
 int main()
 {
-    test_multi();
+    test_yolo();
     
     return 0;
 }
@@ -110,6 +115,3 @@ int main()
 // 通过配置文件创建 pipeline
 // 日志
 // 设置电子围栏
-
-
-python3 detect.py --weights carperson/carperson.pt --source carperson/carperson.mp4

+ 1 - 1
src/nodes/draw/drawNode.cpp

@@ -43,7 +43,7 @@ void DrawNode::work()
                 std::tuple<int, int, int, int> pbox = std::make_tuple(box.left, box.top, box.right, box.bottom);
                 int x, y;
                 std::tie(x, y) = pm.selectOptimalPosition(pbox, image_width, image_height, box.label);
-                std::string text = str_format("%s %.2f id=%d", box.label.c_str(), box.score, b.track_id);
+                std::string text = str_format("%s %.2f id=%d", box.label.c_str(), box.score, box.track_id);
                 cv::putText(image, text, cv::Point(x, y), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(0, 255, 0), 2);
             }
             metaData->draw_image = image;

+ 1 - 1
src/nodes/track/trackNode.cpp

@@ -21,7 +21,7 @@ void TrackNode::work()
             // printf("Node %s get data from %s\n", name_.c_str(), input_buffer.first.c_str());
 
             // auto res = model_->forward(tensor::cvimg(image), image.cols, image.rows, 0.0f, 0.0f);
-            if (!track_)
+            if (!tracker_)
             {
                 printf("track is nullptr\n");
                 continue;

+ 2 - 2
src/nodes/track/trackNode.hpp

@@ -17,13 +17,13 @@ public:
     TrackNode() = delete;
     TrackNode(const std::string& name, int frame_rate, int track_buffer) : BaseNode(name, NODE_TYPE::MID_NODE) 
     {
-        track_ = std::make_shared<BYTETracker>(frame_rate, track_buffer);
+        tracker_ = std::make_shared<BYTETracker>(frame_rate, track_buffer);
     }
     virtual ~TrackNode()  { stop(); };
     void work() override;
 
 private:
-    std::shared_ptr<BYTETracker> track_ = nullptr;
+    std::shared_ptr<BYTETracker> tracker_ = nullptr;
 };
 
 }