Blame view

src/ai_platform/mvpt.h 2.32 KB
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  #include <map>
  #include <mutex>
  #include <thread>
  #include <list>
  #include <vector>
  #include <deque>
  #include <set>
  
  #include "det_obj_header.h"
  #include "acl/acl.h"
  #include "acl/ops/acl_dvpp.h"
  #include "../reprocessing_module/snapshot_reprocessing.h"
  #include "../ai_engine_module/ai_engine_module.h"
  #include "../util/JpegUtil.h"
  
  #include "atlas_licence.h"//授权文件
  
  #include "FeatureAnalysis.h"
  
  #include "task_manager.h"
  
  
  using namespace std;
  
  class DeviceMemory;
  
  class CMultiSourceProcess {
  public:
    CMultiSourceProcess();
    ~CMultiSourceProcess();
  
    int InitAlgorthim(tsl_aiplatform_param vptParam);
    bool AddTask(task_param _cur_task_param);
    bool PauseTask(const string taskID);
    bool RestartTask(const string taskID);
    bool FinishTask(const string taskID);
9e3f3176   Hu Chunming   修复关闭任务崩溃的问题
37
    void Release();
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
38
    void CloseAllTask();
9e3f3176   Hu Chunming   修复关闭任务崩溃的问题
39
    int SnapShot(task_param param, string result_folder);
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
40
41
    int CountRunningTask();
  
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    int GetTaskStatus(const string taskID);
  
  public:
    int algorthim_process_thread();  // 算法处理线程
    void task_finished(const string task_id);
    void decoded_cbk(DeviceMemory* devFrame);
  
    bool CheckTime();
    bool CheckLabel(int devId);
    bool UpdateLabel();
  
  private:
    // 算法相关
    int algorthim_vpt(vector<DeviceMemory*> vec_gpuMem);
    
  private:
    // 工具处理函数
    void clear_finished_task();
    bool finish_task(const string taskID, const bool delete_snapshot);
  
    void vehicle_snapshot(vector<string>& vpt_interest_task_id, vector<vector<int>> deleteObjectID);
    void vehicle_locus_finished(const OBJ_KEY obj_key);
  
    bool save_obj_pic(ObjectInfo&);
  
    int snapshot_task(std::string& uri_or_name, const std::string& file_name, bool bInTask);
  
  private:
    int m_devId; 
  
    snapshot_reprocessing *m_snapshot_reprocessing{nullptr};
  
    VPTProcess vpt_process;
    int skip_frame_ {5}; // 控制跳帧参数
  
    deque<DeviceMemory*> m_RgbDataList;
    mutex m_DataListMtx; 
  
    task_manager m_task_manager;
  
    mutex m_FinishedTaskMtx;
    map<string,bool> m_FinishedTaskMap;
  
    thread* m_pAlgorthimThread{nullptr};
    bool m_bfinish{false};
  
    int m_batch_size{1};
  
    FeatureAnalysis m_feature_analysis;
  
    JpegUtil jpegUtil;
  
ffd1e48a   Hu Chunming   实现结果回调,完成第一版
94
95
    ResultData_CALLBACK m_result_cbk;
  
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
96
97
98
99
    void *skt_handle = nullptr;//授权
  	atlas_licence_check_param check_param;//授权
  	int check_label{-1};//授权 -1=未授权  0=授权  1=授权check日已经check成功(每月一次check
  };