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
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
127
|
#pragma once
#ifdef _MSC_VER
#include <windows.h>
#else
#include <cstddef>
#endif
#include "sy_common.h"
#include <map>
#include <vector>
#include <string>
#include "../ai_engine_module/humanreid.h"
#include "../ai_engine_module/human_parsing.h"
#define VEHICLE_FEA_SIZE 128
#define PLATENUM 8 //车牌号码位数
#define MAX_PALTE_COUNT 10 //每张图片中最多检测出10个车牌
#define SINGLETYPE_BLUE 0 //单排蓝色
#define SINGLETYPE_YELLOW 1 //单排黄色
#define SINGLETYPE_WHITE 2 //单排白色
#define SINGLETYPE_BLACK 3 //单排黑色
#define DOUBLETYPE_YELLOW 4 //双排黄色
#define DOUBLETYPE_WHITE 5 //双排白色
#define NEWENERGYTYPE_YELLOWGREEN 6 //新能源黄绿色
#define NEWENERGYTYPE_WHITEGRA 7 //新能源白绿色
using namespace std;
//返回的检测物体结果信息
#ifndef __VIDEO_OBJECT_INFO__
#define __VIDEO_OBJECT_INFO__
typedef struct video_object_info {
char task_id[128]; //该物体属于的任务ID号
int task_frame_count; //该物体当前出现的帧号
int object_id; //该物体的ID号
int left; //该物体位置的左坐标
int top; //该物体位置的上坐标
int right; //该物体位置的右坐标
int bottom; //该物体位置的下坐标
int index; //该物体所属类别的编号
double confidence; //该物体的置信度
} video_object_info;
#endif
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_INDEX_SIZE];
float hp_feature[HUMANREID_FEATURESIZE];
int vehicle_color_index;
float vehicle_color_prob;
vector<VPDInfo> vec_vpd_cls;
VehiclePlateResult vehicle_plate;
} ObjectData;
// TASK初始化参数
#ifndef __TASK_PARAM__
#define __TASK_PARAM__
typedef struct task_param {
const char *ipc_url; //rtsp流地址
const char *task_id; //外部传入任务id
int dec_type;
|
6fdcb6a5
Hu Chunming
初次提交,代码大体完成编写,完善中
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
} task_param;
#endif
#ifndef __AI_LOG_LEVEL__
#define __AI_LOG_LEVEL__
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, // 重要日志,如结果和严重错误
};
#endif
//VPT初始化参数
#ifndef __TSL_AIPLATFORM_PARAM__
#define __TSL_AIPLATFORM_PARAM__
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; //每个日志最大大小
} tsl_aiplatform_param;
#endif
|