header.h
3.44 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef __AI_PLATFORM_HEADER__
#define __AI_PLATFORM_HEADER__
#ifdef _MSC_VER
#include <windows.h>
#else
#include <cstddef>
#endif
#include "sy_common.h"
#include <map>
#include <vector>
#include <string>
#define HUMANREID_FEATURE_SIZE 384
#define HP_ATTRI_SIZE 16
using namespace std;
typedef struct hp_cls_info //分类结果结构体
{
int res_index; //分类结果
float res_prob; //分类结构体
hp_cls_info() : res_index(0), res_prob(0) {};
} hp_cls_info;
typedef struct VPDInfo
{
int left_;
int top_;
int width_;
int height_;
int index; //类型
float confidence; //置信度
}VPDInfo;
struct PlateNum
{
char character[4];
float maxprob;
int index;
};
struct VehiclePlateResult {
int left_;
int top_;
int width_;
int height_;
float detect_score;
PlateNum recg[8];
float num_score;
int type; //车牌类型。只做车牌检测,车牌类型为:0-单层车牌,1-双层车牌;做车牌检测识别,0-单排蓝色 1-单排黄色 2-单排白色 3-单排黑色 4-双排黄色 5-双排白色 6-新能源黄绿色 7-新能源白绿色
int state; //车牌状态:0-无车牌,1-车牌,2-遮挡车牌
float state_score;//车牌状态置信度
};
typedef struct ObjectData {
string task_id; //该物体属于的任务ID号
int task_frame_count; //该物体当前出现的帧号
int object_id; //该物体的ID号
int left; //该物体位置的左坐标
int top; //该物体位置的上坐标
int right; //该物体位置的右坐标
int bottom; //该物体位置的下坐标
int index; //该物体所属类别的编号
double confidence; //该物体的置信度
string ori_pic_path;
string obj_pic_path;
hp_cls_info hp_cls[HP_ATTRI_SIZE];
float hp_feature[HUMANREID_FEATURE_SIZE];
int vehicle_color_index;
float vehicle_color_prob;
vector<VPDInfo> vec_vpd_cls;
VehiclePlateResult vehicle_plate;
} ObjectData;
// TASK初始化参数
typedef struct task_param {
string ipc_url; //rtsp流地址
string task_id; //外部传入任务id
int skip_frame{0};
string result_folder_little; //目标快照抠图保存地址
string result_folder; //目标快照大图保存地址
} task_param;
enum ai_log_level {
AI_LOG_LEVEL_CLOSE = -1, // 关闭日志
AI_LOG_LEVEL_TRACE = 0, // 跟踪变量
AI_LOG_LEVEL_DEBUG = 1, // 调试日志
AI_LOG_LEVEL_INFO = 2, // 普通日志信息 (如:无关紧要的信息输出)
AI_LOG_LEVEL_WARNING = 3, // 警告日志通知,模块一切正常(如:重要流程通知)
AI_LOG_LEVEL_ERROR = 4, // 重要日志,如结果和严重错误
};
typedef void(*ResultData_CALLBACK)(ObjectData obj);
//VPT初始化参数
typedef struct tsl_aiplatform_param {
int gpuid; //指定显卡id
string models_dir; // 模型文件目录
ai_log_level log_level;
char *log_path; //日志文件路径
int log_days; //日志保存周期
double log_mem; //每个日志最大大小
ResultData_CALLBACK result_cbk;
} tsl_aiplatform_param;
#endif // __AI_PLATFORM_HEADER__