main.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "nodes/base/base.hpp"
  2. #include "nodes/stream/streamNode.hpp"
  3. #include "nodes/infer/inferNode.hpp"
  4. #include "nodes/draw/drawNode.hpp"
  5. #include "nodes/track/trackNode.hpp"
  6. #include "nodes/analyze/analyzeNode.hpp"
  7. #include "nodes/httpPush/httpPush.hpp"
  8. #include "nodes/record/recordNode.hpp"
  9. #include "plog/Log.h"
  10. #include "plog/Initializers/RollingFileInitializer.h"
  11. #include "pipeline/pipeline.hpp"
  12. int main(int argc , char* argv[])
  13. {
  14. plog::init(plog::info, "log/vsp.log", 1000000, 5);
  15. if (argc < 3) {
  16. std::cerr << "Usage: " << argv[0] << " <config_path>" << std::endl;
  17. return 1;
  18. }
  19. const char* config_path = argv[1];
  20. const char* config_type = argv[2];
  21. Pipe::PipelineManager pipeline_manager;
  22. if (std::string(config_type) == "yaml") {
  23. pipeline_manager.create_from_yaml(std::string(config_path));
  24. } else if (std::string(config_type) == "json") {
  25. pipeline_manager.create_from_json(std::string(config_path));
  26. } else {
  27. std::cerr << "Unknown config type: " << config_type << std::endl;
  28. return 1;
  29. }
  30. pipeline_manager.create_from_json(std::string(json_path));
  31. for (const auto& p : pipeline_manager.getPipelines()) {
  32. std::cout << "Pipeline ID: " << p.pipeline_id << ", Description: " << p.description << ", Nodes: " << p.nodes.size() << std::endl;
  33. for(const auto& node : p.nodes) {
  34. std::cout << " - Node Name: " << node->get_name() << std::endl;
  35. }
  36. }
  37. pipeline_manager.start_all_pipelines();
  38. pipeline_manager.show_all_pipeline();
  39. getchar();
  40. return 0;
  41. }
  42. // TODO
  43. // 硬解码、软解码 完成 软解使用opencv + ffmpeg,硬解使用nvcodec + ffmpeg
  44. // 模型复用 完成,基类加锁保证一致性
  45. // 画图节点 完成
  46. // 推送节点 基本完成
  47. // 日志 完成
  48. // YOLO11 seg 完成
  49. // 通过配置文件创建 pipeline 完成
  50. // 分析节点
  51. // 置信度阈值修改
  52. // 设置电子围栏
  53. // 数据传输过程中使用显存指针