vpc_util.h
1.16 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef ___VPC_UTIL_H__
#define ___VPC_UTIL_H__
#include "acl/acl.h"
#include "acl/ops/acl_dvpp.h"
#include "acl/dvpp/hi_dvpp.h"
#include "../ai_platform/header.h"
#include <string>
#include <vector>
using namespace std;
struct vpc_img_info{
acldvppPicDesc* pic_desc{nullptr};
string task_id; //该物体属于的任务ID号
int task_frame_count; //该物体当前出现的帧号
int object_id; //该物体的ID号
int index; //该物体所属类别的编号
double confidence; //该物体的置信度
};
class DeviceMemory;
class VPCUtil {
public:
int vpc_crop(acldvppPicDesc *input_pic_desc, video_object_info obj);
int vpc_crop_init(int32_t devId);
vector<vpc_img_info> vpc_crop_batch(DeviceMemory *devMem, vector<video_object_info> objs);
void vpc_img_release(vpc_img_info );
void vpc_imgList_release(vector<vpc_img_info>& );
void vpc_crop_release();
vpc_img_info vpc_devMem2vpcImg(DeviceMemory *devMem);
private:
int32_t deviceId_;
aclrtContext context_;
aclrtStream stream_;
acldvppChannelDesc *dvppChannelDesc_;
};
#endif //___VPC_UTIL_H__