diff --git a/src/ai_engine_module/HumanFeature.h b/src/ai_engine_module/HumanFeature.h index f26fb16..401b31d 100644 --- a/src/ai_engine_module/HumanFeature.h +++ b/src/ai_engine_module/HumanFeature.h @@ -1,3 +1,6 @@ +#ifndef __AI_ENGINE_MODULE_HUMAN_FEATURE__ +#define __AI_ENGINE_MODULE_HUMAN_FEATURE__ + #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -8,7 +11,7 @@ using namespace std; struct HFResult{ - float feature[HUMANREID_FEATURESIZE]; + float feature[HUMANREID_FEATURE_SIZE]; }; class HumanFeature @@ -27,4 +30,6 @@ private: int m_devId; aclrtContext m_algorthim_ctx; void* m_handle{nullptr}; -}; \ No newline at end of file +}; + +#endif // __AI_ENGINE_MODULE_HUMAN_FEATURE__ \ No newline at end of file diff --git a/src/ai_engine_module/HumanParsing.h b/src/ai_engine_module/HumanParsing.h index 2dd3b58..d74f6ed 100644 --- a/src/ai_engine_module/HumanParsing.h +++ b/src/ai_engine_module/HumanParsing.h @@ -1,3 +1,6 @@ +#ifndef __AI_ENGINE_MODULE_HUMAN_PARSING__ +#define __AI_ENGINE_MODULE_HUMAN_PARSING__ + #include #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -24,4 +27,6 @@ private: int m_devId; aclrtContext m_algorthim_ctx; void* m_handle{nullptr}; -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/ai_engine_module/VPDProcess.h b/src/ai_engine_module/VPDProcess.h index 9616248..64b2ee2 100644 --- a/src/ai_engine_module/VPDProcess.h +++ b/src/ai_engine_module/VPDProcess.h @@ -1,3 +1,6 @@ +#ifndef __AI_ENGINE_MODULE_VPD__ +#define __AI_ENGINE_MODULE_VPD__ + #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -30,4 +33,6 @@ private: int m_devId; aclrtContext m_algorthim_ctx; void* m_handle{nullptr}; -}; \ No newline at end of file +}; + +#endif // __AI_ENGINE_MODULE_VPD__ \ No newline at end of file diff --git a/src/ai_engine_module/VPTProcess.h b/src/ai_engine_module/VPTProcess.h index 5219cfc..3755a7b 100755 --- a/src/ai_engine_module/VPTProcess.h +++ b/src/ai_engine_module/VPTProcess.h @@ -4,7 +4,9 @@ * UpdateDate: 20170705 * Content: 人车物监测跟踪 ********************************************************************************************/ -#pragma once +#ifndef __AI_ENGINE_MODULE_VPT__ +#define __AI_ENGINE_MODULE_VPT__ + #include #include #include @@ -82,3 +84,6 @@ private: int m_max_batchsize; map taskTrackers; }; + + +#endif // __AI_ENGINE_MODULE_VPT__ \ No newline at end of file diff --git a/src/ai_engine_module/VehicleColor.h b/src/ai_engine_module/VehicleColor.h index c2975b4..a58ff42 100644 --- a/src/ai_engine_module/VehicleColor.h +++ b/src/ai_engine_module/VehicleColor.h @@ -1,3 +1,6 @@ +#ifndef __AI_ENGINE_MODULE_VEHICLE_COLOR__ +#define __AI_ENGINE_MODULE_VEHICLE_COLOR__ + #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -28,4 +31,6 @@ private: int m_devId; aclrtContext m_algorthim_ctx; void* m_handle{nullptr}; -}; \ No newline at end of file +}; + +#endif // __AI_ENGINE_MODULE_VEHICLE_COLOR__ \ No newline at end of file diff --git a/src/ai_engine_module/VehiclePlate.h b/src/ai_engine_module/VehiclePlate.h index dfc8bed..90194ec 100644 --- a/src/ai_engine_module/VehiclePlate.h +++ b/src/ai_engine_module/VehiclePlate.h @@ -1,3 +1,6 @@ +#ifndef __AI_ENGINE_MODULE_VEHICLE_PLATE__ +#define __AI_ENGINE_MODULE_VEHICLE_PLATE__ + #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -25,4 +28,6 @@ private: int m_devId; aclrtContext m_algorthim_ctx; void* m_handle{nullptr}; -}; \ No newline at end of file +}; + +#endif // __AI_ENGINE_MODULE_VEHICLE_PLATE__ \ No newline at end of file diff --git a/src/ai_platform/FeatureAnalysis.cpp b/src/ai_platform/FeatureAnalysis.cpp index 70f20e2..4e46efc 100644 --- a/src/ai_platform/FeatureAnalysis.cpp +++ b/src/ai_platform/FeatureAnalysis.cpp @@ -88,7 +88,7 @@ void FeatureAnalysis::update_human_info(ObjectInfo& res_obj, vpc_img_info& img_i if (vec_hf_res.size() > 0) { HFResult hf_res = vec_hf_res[0]; - memcpy(res_obj.hp_feature, hf_res.feature, sizeof(float) * HUMANREID_FEATURESIZE); + memcpy(res_obj.hp_feature, hf_res.feature, sizeof(float) * HUMANREID_FEATURE_SIZE); } } diff --git a/src/ai_platform/header.h b/src/ai_platform/header.h index fcd51a4..4d9dcf1 100755 --- a/src/ai_platform/header.h +++ b/src/ai_platform/header.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef __AI_PLATFORM_HEADER__ +#define __AI_PLATFORM_HEADER__ #ifdef _MSC_VER #include @@ -13,11 +14,11 @@ #include #include -#include "../ai_engine_module/humanreid.h" -#include "../ai_engine_module/human_parsing.h" -#define VEHICLE_FEA_SIZE 128 +#define HUMANREID_FEATURE_SIZE 384 +#define HP_ATTRI_SIZE 16 + #define PLATENUM 8 //车牌号码位数 #define MAX_PALTE_COUNT 10 //每张图片中最多检测出10个车牌 @@ -35,8 +36,6 @@ 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; //该物体当前出现的帧号 @@ -48,7 +47,6 @@ typedef struct video_object_info { int index; //该物体所属类别的编号 double confidence; //该物体的置信度 } video_object_info; -#endif @@ -106,8 +104,8 @@ typedef struct ObjectData { string ori_pic_path; string obj_pic_path; - hp_cls_info hp_cls[HP_ATTRI_INDEX_SIZE]; - float hp_feature[HUMANREID_FEATURESIZE]; + hp_cls_info hp_cls[HP_ATTRI_SIZE]; + float hp_feature[HUMANREID_FEATURE_SIZE]; int vehicle_color_index; float vehicle_color_prob; @@ -118,9 +116,6 @@ typedef struct ObjectData { // TASK初始化参数 -#ifndef __TASK_PARAM__ -#define __TASK_PARAM__ - typedef struct task_param { string ipc_url; //rtsp流地址 string task_id; //外部传入任务id @@ -129,10 +124,8 @@ typedef struct task_param { string result_folder_little; //目标快照抠图保存地址 string result_folder; //目标快照大图保存地址 } 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, // 跟踪变量 @@ -141,12 +134,9 @@ enum ai_log_level { 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; // 模型文件目录 @@ -156,4 +146,5 @@ typedef struct tsl_aiplatform_param { int log_days; //日志保存周期 double log_mem; //每个日志最大大小 } tsl_aiplatform_param; -#endif \ No newline at end of file + +#endif // __AI_PLATFORM_HEADER__ \ No newline at end of file diff --git a/src/ai_platform/mvpt.cpp b/src/ai_platform/mvpt.cpp index 50e4b8c..8777108 100755 --- a/src/ai_platform/mvpt.cpp +++ b/src/ai_platform/mvpt.cpp @@ -22,7 +22,7 @@ // #define VEHICLE_MULTI_BOXES -#define AUTHORIZATION +// #define AUTHORIZATION #define productSN "51C4B28135604F649671727185949A91" //linux 通途抓拍引擎产品序列号 using namespace std;