Commit b5aaf53a05fdbe5e81cb72f0257a0c758b5fcf0a
1 parent
5f4efeaa
雨棚模型升级
Showing
12 changed files
with
183 additions
and
44 deletions
bin/libmotor_rainshed_vdec.so
0 → 100755
No preview for this file type
bin/models/village/motor_rainshed_310p.om
0 → 100644
No preview for this file type
src/Makefile
@@ -38,7 +38,7 @@ lib=-lacl_dvpp -lascendcl -lacl_dvpp_mpi -lruntime -lascendalog -lc_sec -lmsprof | @@ -38,7 +38,7 @@ lib=-lacl_dvpp -lascendcl -lacl_dvpp_mpi -lruntime -lascendalog -lc_sec -lmsprof | ||
38 | -lplatform -lgraph_base -lqos_manager | 38 | -lplatform -lgraph_base -lqos_manager |
39 | 39 | ||
40 | LIBS= -L $(SPDLOG_ROOT)/lib -l:libspdlog.a \ | 40 | LIBS= -L $(SPDLOG_ROOT)/lib -l:libspdlog.a \ |
41 | - -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lphone_motor_det -lhcp_vdec -lhs_motor_process\ | 41 | + -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lphone_motor_det -lhcp_vdec -lmotor_rainshed_vdec -lhs_motor_process\ |
42 | -L $(OPENCV_ROOT)/lib -lopencv_world\ | 42 | -L $(OPENCV_ROOT)/lib -lopencv_world\ |
43 | -L $(JSON_ROOT)/lib -ljsoncpp \ | 43 | -L $(JSON_ROOT)/lib -ljsoncpp \ |
44 | -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ | 44 | -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ |
src/ai_engine_module/motocycle_refit_phone_process.cpp
@@ -12,7 +12,7 @@ namespace ai_engine_module | @@ -12,7 +12,7 @@ namespace ai_engine_module | ||
12 | { | 12 | { |
13 | static std::set<algorithm_type_t> algor_type_list_ = { | 13 | static std::set<algorithm_type_t> algor_type_list_ = { |
14 | algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE, | 14 | algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE, |
15 | - algorithm_type_t::NONMOTOR_VEHICLE_REFIT, | 15 | + // algorithm_type_t::NONMOTOR_VEHICLE_REFIT, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | inline bool is_valid_label(const label_t &label) { | 18 | inline bool is_valid_label(const label_t &label) { |
@@ -334,8 +334,8 @@ namespace ai_engine_module | @@ -334,8 +334,8 @@ namespace ai_engine_module | ||
334 | auto& e = id_to_mn_[obj_key]; | 334 | auto& e = id_to_mn_[obj_key]; |
335 | ++e.m_frame; | 335 | ++e.m_frame; |
336 | 336 | ||
337 | - if (algor_type == algorithm_type_t::NONMOTOR_VEHICLE_REFIT && refit_pred.res_index != 1) | ||
338 | - continue; | 337 | + // if (algor_type == algorithm_type_t::NONMOTOR_VEHICLE_REFIT && refit_pred.res_index != 1) |
338 | + // continue; | ||
339 | 339 | ||
340 | // 数量小于设定阈值不报警 | 340 | // 数量小于设定阈值不报警 |
341 | if (algor_type == algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE) { | 341 | if (algor_type == algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE) { |
src/ai_engine_module/motocycle_refit_process.cpp
@@ -71,7 +71,8 @@ namespace ai_engine_module | @@ -71,7 +71,8 @@ namespace ai_engine_module | ||
71 | MotorRefitProcess::~MotorRefitProcess() | 71 | MotorRefitProcess::~MotorRefitProcess() |
72 | { | 72 | { |
73 | if (tools_) { | 73 | if (tools_) { |
74 | - hcp_release(&tools_); | 74 | + // hcp_release(&tools_); |
75 | + mrc_release(&tools_); | ||
75 | tools_ = nullptr; | 76 | tools_ = nullptr; |
76 | } | 77 | } |
77 | if (m_algorthim_ctx) { | 78 | if (m_algorthim_ctx) { |
@@ -83,10 +84,13 @@ namespace ai_engine_module | @@ -83,10 +84,13 @@ namespace ai_engine_module | ||
83 | { | 84 | { |
84 | init_ = false; | 85 | init_ = false; |
85 | 86 | ||
86 | - string model_path = models_dir + "/models/village/hcp211008_310p.om" ; | ||
87 | - LOG_INFO("hcp 版本:{} 模型路径:{}", hcp_get_version(), model_path); | 87 | + // string model_path = models_dir + "/models/village/hcp211008_310p.om" ; |
88 | + // LOG_INFO("hcp 版本:{} 模型路径:{}", hcp_get_version(), model_path); | ||
89 | + string model_path = models_dir + "/models/village/motor_rainshed_310p.om" ; | ||
90 | + LOG_INFO("mRainCls 版本:{} 模型路径:{}", mrc_get_version(), model_path); | ||
88 | 91 | ||
89 | - hcp_param param; | 92 | + // hcp_param param; |
93 | + mrc_param param; | ||
90 | char modelNames[100]; | 94 | char modelNames[100]; |
91 | strcpy(modelNames, model_path.c_str()); | 95 | strcpy(modelNames, model_path.c_str()); |
92 | param.modelNames = modelNames; | 96 | param.modelNames = modelNames; |
@@ -97,7 +101,8 @@ namespace ai_engine_module | @@ -97,7 +101,8 @@ namespace ai_engine_module | ||
97 | ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1); | 101 | ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1); |
98 | 102 | ||
99 | int status; | 103 | int status; |
100 | - if (!(init_ = (0 == (status = hcp_init(&tools_, param))))) | 104 | + // if (!(init_ = (0 == (status = hcp_init(&tools_, param))))) |
105 | + if (!(init_ = (0 == (status = mrc_init(&tools_, param))))) | ||
101 | LOG_ERROR("Init MotorRefitProcessSdk failed error code is {}", status); | 106 | LOG_ERROR("Init MotorRefitProcessSdk failed error code is {}", status); |
102 | else | 107 | else |
103 | if (!task_param_manager_) | 108 | if (!task_param_manager_) |
@@ -269,14 +274,16 @@ namespace ai_engine_module | @@ -269,14 +274,16 @@ namespace ai_engine_module | ||
269 | } | 274 | } |
270 | /* 2. collection result. */ | 275 | /* 2. collection result. */ |
271 | int n_input_image = flattened_imgs.size(); | 276 | int n_input_image = flattened_imgs.size(); |
272 | - hcp_analysis_result model_results[n_input_image]; | 277 | + // hcp_analysis_result model_results[n_input_image]; |
278 | + mrc_result model_results[n_input_image]; | ||
273 | { | 279 | { |
274 | int steps = (n_input_image + MAX_BATCH - 1) / MAX_BATCH; | 280 | int steps = (n_input_image + MAX_BATCH - 1) / MAX_BATCH; |
275 | for (int step = 0; step < steps; ++step) | 281 | for (int step = 0; step < steps; ++step) |
276 | { | 282 | { |
277 | int offset = step * MAX_BATCH; | 283 | int offset = step * MAX_BATCH; |
278 | int batch_size = (step == steps - 1) ? n_input_image - offset : MAX_BATCH; | 284 | int batch_size = (step == steps - 1) ? n_input_image - offset : MAX_BATCH; |
279 | - hcp_batch(tools_, flattened_imgs.data() + offset, batch_size, model_results + offset); | 285 | + // hcp_batch(tools_, flattened_imgs.data() + offset, batch_size, model_results + offset); |
286 | + mrc_batch(tools_, flattened_imgs.data() + offset, batch_size, model_results + offset); | ||
280 | } | 287 | } |
281 | } | 288 | } |
282 | 289 | ||
@@ -295,8 +302,11 @@ namespace ai_engine_module | @@ -295,8 +302,11 @@ namespace ai_engine_module | ||
295 | const auto& src_img = vec_det_input_images[flattened_idx_to_batch_idx[n]]; | 302 | const auto& src_img = vec_det_input_images[flattened_idx_to_batch_idx[n]]; |
296 | auto &model_result = model_results[n]; | 303 | auto &model_result = model_results[n]; |
297 | 304 | ||
298 | - auto &pred = model_result.res_objs[12]; // 211008模型索引12对应是否有雨棚 | ||
299 | - const label_t label = static_cast<label_t>(pred.res_index); | 305 | + // auto &pred = model_result.res_objs[12]; // 211008模型索引12对应是否有雨棚 |
306 | + // const label_t label = static_cast<label_t>(pred.res_index); | ||
307 | + auto &pred = model_result; | ||
308 | + const label_t label = static_cast<label_t>(pred.index); | ||
309 | + | ||
300 | 310 | ||
301 | for (auto algor_type_iter = algors.begin();algor_type_iter != algors.end(); ++algor_type_iter) { | 311 | for (auto algor_type_iter = algors.begin();algor_type_iter != algors.end(); ++algor_type_iter) { |
302 | const algorithm_type_t algor_type = *algor_type_iter; | 312 | const algorithm_type_t algor_type = *algor_type_iter; |
src/ai_engine_module/motocycle_refit_process.h
@@ -7,7 +7,8 @@ | @@ -7,7 +7,8 @@ | ||
7 | #include "../ai_platform/task_param_manager.h" | 7 | #include "../ai_platform/task_param_manager.h" |
8 | #include "../ai_platform/macro_definition.h" | 8 | #include "../ai_platform/macro_definition.h" |
9 | #include "ai_engine_header.h" | 9 | #include "ai_engine_header.h" |
10 | -#include "human_car_parsing.h" | 10 | +// #include "human_car_parsing.h" |
11 | +#include "motor_rainshed_cls.h" | ||
11 | #include "acl/acl.h" | 12 | #include "acl/acl.h" |
12 | #include "acl/ops/acl_dvpp.h" | 13 | #include "acl/ops/acl_dvpp.h" |
13 | 14 | ||
@@ -26,8 +27,8 @@ namespace ai_engine_module | @@ -26,8 +27,8 @@ namespace ai_engine_module | ||
26 | 27 | ||
27 | enum class label_t { | 28 | enum class label_t { |
28 | PLACEHOLDER = -1, | 29 | PLACEHOLDER = -1, |
29 | - norefit = 0, //无雨棚 | ||
30 | - refit = 1, //有雨棚 | 30 | + norefit = 1, //无雨棚 |
31 | + refit = 0, //有雨棚 | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | typedef struct input_data_wrap_t | 34 | typedef struct input_data_wrap_t |
src/ai_engine_module/motor_rainshed_cls.h
0 → 100644
1 | +/************************************************************************* | ||
2 | +* Version: motor_rainshed_cls_v0.0.0.20230921 | ||
3 | +* CopyRight : 中国科学院自动化所模式识别实验室图像视频组 | ||
4 | +* UpdateDate:20230921 | ||
5 | +* Content : 二轮车是否加装雨棚 | ||
6 | +*************************************************************************/ | ||
7 | +#ifndef MOTORRAINCLS_H_ | ||
8 | +#define MOTORRAINCLS_H_ | ||
9 | + | ||
10 | +#if _MSC_VER | ||
11 | +#ifdef MOTORRAINCLS_EXPORTS | ||
12 | +#define MOTORRAINCLS_API __declspec(dllexport) | ||
13 | +#else | ||
14 | +#define MOTORRAINCLS_API __declspec(dllimport) | ||
15 | +#endif | ||
16 | +#else | ||
17 | +#define MOTORRAINCLS_API __attribute__ ((visibility ("default"))) | ||
18 | +#endif | ||
19 | + | ||
20 | +#include "sy_common.h" | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | +#ifndef MAX_BATCH_SIZE | ||
25 | +#define MAX_BATCH_SIZE 16 | ||
26 | +#endif | ||
27 | + | ||
28 | + | ||
29 | +#ifdef __cplusplus | ||
30 | +extern "C" | ||
31 | +{ | ||
32 | +#endif | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | +//分类结果 | ||
37 | +#ifndef MRCRESULT_ | ||
38 | +#define MRCRESULT_ | ||
39 | +typedef struct mrc_result | ||
40 | +{ | ||
41 | + float score; | ||
42 | + int index; | ||
43 | +}mrc_result; | ||
44 | +#endif | ||
45 | + | ||
46 | + | ||
47 | +#ifndef __MRCPARAM__ | ||
48 | +#define __MRCPARAM__ | ||
49 | + typedef struct mrc_param | ||
50 | + { | ||
51 | + //int mode; //运行模式(DEVICE_GPU / DEVICE_CPU) | ||
52 | + //mrc_param() :mode(DEVICE_GPU), gpuid(0) {}; | ||
53 | + int devId; //ָ指定显卡id | ||
54 | + char* modelNames; | ||
55 | + float thresld; //阈值 | ||
56 | + }mrc_param; | ||
57 | +#endif | ||
58 | + | ||
59 | + /************************************************************************* | ||
60 | + * FUNCTION: mrc_init | ||
61 | + * PURPOSE: 载入模型 | ||
62 | + * PARAM: | ||
63 | + [in] handle - 句柄 | ||
64 | + [in] params - 参数 | ||
65 | + * RETURN: 成功(0)或者错误代码 | ||
66 | + * NOTES: | ||
67 | + *************************************************************************/ | ||
68 | + MOTORRAINCLS_API int mrc_init(void ** handle, mrc_param param); | ||
69 | + | ||
70 | + /************************************************************************* | ||
71 | + * FUNCTION: mrc_process | ||
72 | + * PURPOSE: 二轮车加装雨棚分类 | ||
73 | + * PARAM: | ||
74 | + [in] handle - 检测句柄 | ||
75 | + [in] img_data - 图像数据 | ||
76 | + [in] result - 结果 内存在外部申请 | ||
77 | + * RETURN: 成功(0) 或 错误代码(< 0) | ||
78 | + * NOTES: | ||
79 | + *************************************************************************/ | ||
80 | + MOTORRAINCLS_API int mrc_process(void *handle, sy_img img_data, mrc_result * result); | ||
81 | + | ||
82 | + /************************************************************************* | ||
83 | + * FUNCTION: mrc_batch | ||
84 | + * PURPOSE: 二轮车加装雨棚分类 batch | ||
85 | + * PARAM: | ||
86 | + [in] handle - 检测句柄 | ||
87 | + [in] img_data_array - 图像数据 | ||
88 | + [in] batch_size - 图像数目 | ||
89 | + [in] result - 结果 内存在外部申请 | ||
90 | + * RETURN: 成功(0) 或 错误代码(< 0) | ||
91 | + * NOTES: | ||
92 | + *************************************************************************/ | ||
93 | + MOTORRAINCLS_API int mrc_batch(void *handle, sy_img* img_data_array, int batch_size, mrc_result * result); | ||
94 | + | ||
95 | + | ||
96 | + /************************************************************************* | ||
97 | + * FUNCTION: mrc_release | ||
98 | + * PURPOSE: 释放 | ||
99 | + * PARAM: | ||
100 | + [in] handle - handle | ||
101 | + * RETURN: NULL | ||
102 | + * NOTES: | ||
103 | + *************************************************************************/ | ||
104 | + MOTORRAINCLS_API void mrc_release(void ** handle); | ||
105 | + | ||
106 | + | ||
107 | + /************************************************************************* | ||
108 | + * FUNCTION: mrc_get_version | ||
109 | + * PURPOSE: | ||
110 | + * PARAM: NULL | ||
111 | + * RETURN: 版本号 | ||
112 | + * NOTES: | ||
113 | + *************************************************************************/ | ||
114 | + MOTORRAINCLS_API const char * mrc_get_version(); | ||
115 | + | ||
116 | +#ifdef __cplusplus | ||
117 | +}; | ||
118 | +#endif | ||
119 | + | ||
120 | +#endif |
src/ai_platform/MultiSourceProcess.cpp
@@ -189,12 +189,12 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | @@ -189,12 +189,12 @@ int CMultiSourceProcess::InitAlgorthim(tsl_aiplatform_param vptParam){ | ||
189 | if (!motor_phoneprocess_.init(vptParam.gpuid, models_dir)) { | 189 | if (!motor_phoneprocess_.init(vptParam.gpuid, models_dir)) { |
190 | LOG_FATAL("Init motor_phone failed"); | 190 | LOG_FATAL("Init motor_phone failed"); |
191 | return -1; | 191 | return -1; |
192 | - } | 192 | + }*/ |
193 | //电动车改装(加雨棚) | 193 | //电动车改装(加雨棚) |
194 | if (!motor_refitprocess_.init(vptParam.gpuid, models_dir)) { | 194 | if (!motor_refitprocess_.init(vptParam.gpuid, models_dir)) { |
195 | LOG_FATAL("Init motor_refit failed"); | 195 | LOG_FATAL("Init motor_refit failed"); |
196 | return -1; | 196 | return -1; |
197 | - }*/ | 197 | + } |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | #ifdef WITH_FACE_DET_SS | 200 | #ifdef WITH_FACE_DET_SS |
@@ -710,7 +710,7 @@ bool CMultiSourceProcess::finish_task(const string taskID, const bool delete_sna | @@ -710,7 +710,7 @@ bool CMultiSourceProcess::finish_task(const string taskID, const bool delete_sna | ||
710 | motor_hsprocess_.force_release_result(taskID); | 710 | motor_hsprocess_.force_release_result(taskID); |
711 | motor_refit_phoneprocess_.force_release_result(taskID); | 711 | motor_refit_phoneprocess_.force_release_result(taskID); |
712 | // motor_phoneprocess_.force_release_result(taskID); | 712 | // motor_phoneprocess_.force_release_result(taskID); |
713 | - // motor_refitprocess_.force_release_result(taskID); | 713 | + motor_refitprocess_.force_release_result(taskID); |
714 | 714 | ||
715 | m_task_param_manager->delete_task_param(taskID); | 715 | m_task_param_manager->delete_task_param(taskID); |
716 | #endif | 716 | #endif |
@@ -899,12 +899,12 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){ | @@ -899,12 +899,12 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){ | ||
899 | algorithm_truck_manned(vpt_interest_task_id, vec_vptMem, vptResult); | 899 | algorithm_truck_manned(vpt_interest_task_id, vec_vptMem, vptResult); |
900 | // 二轮车超员/未戴盔 | 900 | // 二轮车超员/未戴盔 |
901 | algorithm_motor_hs_process(vpt_interest_task_id, vec_vptMem, vptResult); | 901 | algorithm_motor_hs_process(vpt_interest_task_id, vec_vptMem, vptResult); |
902 | - // 二轮车驾乘人员使用手机及加雨棚 | 902 | + // 二轮车驾乘人员使用手机(人骑车辅助版本) |
903 | algorithm_motor_refit_phone_process(vpt_interest_task_id, vec_vptMem, vptResult); | 903 | algorithm_motor_refit_phone_process(vpt_interest_task_id, vec_vptMem, vptResult); |
904 | /*// 二轮车驾乘人员使用手机 | 904 | /*// 二轮车驾乘人员使用手机 |
905 | - algorithm_motor_phone_process(vpt_interest_task_id, vec_vptMem, vptResult); | 905 | + algorithm_motor_phone_process(vpt_interest_task_id, vec_vptMem, vptResult);*/ |
906 | // 电动车改装(加雨棚) | 906 | // 电动车改装(加雨棚) |
907 | - algorithm_motor_refit_process(vpt_interest_task_id, vec_vptMem, vptResult);*/ | 907 | + algorithm_motor_refit_process(vpt_interest_task_id, vec_vptMem, vptResult); |
908 | village_snapshot(vpt_interest_task_id, vec_vptMem, deleteObjectID); | 908 | village_snapshot(vpt_interest_task_id, vec_vptMem, deleteObjectID); |
909 | #endif | 909 | #endif |
910 | 910 | ||
@@ -1357,7 +1357,7 @@ void CMultiSourceProcess::algorithm_motor_hs_process(vector<string>& vpt_interes | @@ -1357,7 +1357,7 @@ void CMultiSourceProcess::algorithm_motor_hs_process(vector<string>& vpt_interes | ||
1357 | } | 1357 | } |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | -// 二轮车驾乘人员使用手机及加雨棚 | 1360 | +// 二轮车驾乘人员使用手机(人骑车辅助版) |
1361 | void CMultiSourceProcess::algorithm_motor_refit_phone_process(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vpt_interest_imgs, | 1361 | void CMultiSourceProcess::algorithm_motor_refit_phone_process(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vpt_interest_imgs, |
1362 | vector<onelevel_det_result>& vptResult) { | 1362 | vector<onelevel_det_result>& vptResult) { |
1363 | 1363 | ||
@@ -1372,8 +1372,9 @@ void CMultiSourceProcess::algorithm_motor_refit_phone_process(vector<string>& vp | @@ -1372,8 +1372,9 @@ void CMultiSourceProcess::algorithm_motor_refit_phone_process(vector<string>& vp | ||
1372 | auto task_id = *_task_id_iter; | 1372 | auto task_id = *_task_id_iter; |
1373 | auto algor_map = m_task_param_manager->get_task_other_param(task_id); | 1373 | auto algor_map = m_task_param_manager->get_task_other_param(task_id); |
1374 | 1374 | ||
1375 | - if (algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE) != algor_map->end() || | ||
1376 | - algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_REFIT) != algor_map->end()) { | 1375 | + // if (algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE) != algor_map->end() || |
1376 | + // algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_REFIT) != algor_map->end()) { | ||
1377 | + if (algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE) != algor_map->end()) { | ||
1377 | interest_task_id.emplace_back(task_id); | 1378 | interest_task_id.emplace_back(task_id); |
1378 | interest_imgs.emplace_back(vpt_interest_imgs[_idx]); | 1379 | interest_imgs.emplace_back(vpt_interest_imgs[_idx]); |
1379 | interest_vpt_result.emplace_back(vptResult[_idx]); | 1380 | interest_vpt_result.emplace_back(vptResult[_idx]); |
@@ -1409,7 +1410,7 @@ void CMultiSourceProcess::algorithm_motor_phone_process(vector<string>& vpt_inte | @@ -1409,7 +1410,7 @@ void CMultiSourceProcess::algorithm_motor_phone_process(vector<string>& vpt_inte | ||
1409 | if (!interest_imgs.empty()){ | 1410 | if (!interest_imgs.empty()){ |
1410 | motor_phoneprocess_.update_mstreams(interest_task_id, interest_imgs, interest_vpt_result); | 1411 | motor_phoneprocess_.update_mstreams(interest_task_id, interest_imgs, interest_vpt_result); |
1411 | } | 1412 | } |
1412 | -} | 1413 | +}*/ |
1413 | 1414 | ||
1414 | // 电动车改装(加雨棚) | 1415 | // 电动车改装(加雨棚) |
1415 | void CMultiSourceProcess::algorithm_motor_refit_process(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vpt_interest_imgs, | 1416 | void CMultiSourceProcess::algorithm_motor_refit_process(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vpt_interest_imgs, |
@@ -1436,7 +1437,7 @@ void CMultiSourceProcess::algorithm_motor_refit_process(vector<string>& vpt_inte | @@ -1436,7 +1437,7 @@ void CMultiSourceProcess::algorithm_motor_refit_process(vector<string>& vpt_inte | ||
1436 | if (!interest_imgs.empty()){ | 1437 | if (!interest_imgs.empty()){ |
1437 | motor_refitprocess_.update_mstreams(interest_task_id, interest_imgs, interest_vpt_result); | 1438 | motor_refitprocess_.update_mstreams(interest_task_id, interest_imgs, interest_vpt_result); |
1438 | } | 1439 | } |
1439 | -}*/ | 1440 | +} |
1440 | 1441 | ||
1441 | // for snapshot algorithm. 轨迹结束目标 做最后的结果返回(当前返回算法结果+快照保存路径) | 1442 | // for snapshot algorithm. 轨迹结束目标 做最后的结果返回(当前返回算法结果+快照保存路径) |
1442 | void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vec_vptMem, vector<vector<int>> deleteObjectID) { | 1443 | void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id, vector<DeviceMemory*> vec_vptMem, vector<vector<int>> deleteObjectID) { |
@@ -1579,8 +1580,8 @@ void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id, | @@ -1579,8 +1580,8 @@ void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id, | ||
1579 | const auto &algor_other_params = task_other_params->find(algorithm_type_t::NONMOTOR_VEHICLE_REFIT); | 1580 | const auto &algor_other_params = task_other_params->find(algorithm_type_t::NONMOTOR_VEHICLE_REFIT); |
1580 | const algor_basic_config_param_t *basic_param = algor_other_params->second->basic_param; | 1581 | const algor_basic_config_param_t *basic_param = algor_other_params->second->basic_param; |
1581 | 1582 | ||
1582 | - // auto result = motor_refitprocess_.get_result_by_objectid(ai_engine_module::obj_key_t{obj_key.obj_id, obj_key.video_id, algorithm_type_t::NONMOTOR_VEHICLE_REFIT}); | ||
1583 | - auto result = motor_refit_phoneprocess_.get_result_by_objectid(ai_engine_module::obj_key_t{obj_key.obj_id, obj_key.video_id, algorithm_type_t::NONMOTOR_VEHICLE_REFIT}); | 1583 | + auto result = motor_refitprocess_.get_result_by_objectid(ai_engine_module::obj_key_t{obj_key.obj_id, obj_key.video_id, algorithm_type_t::NONMOTOR_VEHICLE_REFIT}); |
1584 | + // auto result = motor_refit_phoneprocess_.get_result_by_objectid(ai_engine_module::obj_key_t{obj_key.obj_id, obj_key.video_id, algorithm_type_t::NONMOTOR_VEHICLE_REFIT}); | ||
1584 | if (result.get()) { | 1585 | if (result.get()) { |
1585 | village_alarm = true; | 1586 | village_alarm = true; |
1586 | algorithm_types.push_back((int)algorithm_type_t::NONMOTOR_VEHICLE_REFIT); | 1587 | algorithm_types.push_back((int)algorithm_type_t::NONMOTOR_VEHICLE_REFIT); |
src/ai_platform/MultiSourceProcess.h
@@ -151,7 +151,7 @@ private: | @@ -151,7 +151,7 @@ private: | ||
151 | ai_engine_module::motocycle_hs_process::MotorHsProcess motor_hsprocess_; | 151 | ai_engine_module::motocycle_hs_process::MotorHsProcess motor_hsprocess_; |
152 | ai_engine_module::motocycle_refit_phone_process::MotorRefitPhoneProcess motor_refit_phoneprocess_; | 152 | ai_engine_module::motocycle_refit_phone_process::MotorRefitPhoneProcess motor_refit_phoneprocess_; |
153 | // ai_engine_module::motocycle_phone_process::MotorPhoneProcess motor_phoneprocess_; | 153 | // ai_engine_module::motocycle_phone_process::MotorPhoneProcess motor_phoneprocess_; |
154 | - // ai_engine_module::motocycle_refit_process::MotorRefitProcess motor_refitprocess_; | 154 | + ai_engine_module::motocycle_refit_process::MotorRefitProcess motor_refitprocess_; |
155 | 155 | ||
156 | face_det_ai_engine m_face_det_ai_engine; // 人脸检测 | 156 | face_det_ai_engine m_face_det_ai_engine; // 人脸检测 |
157 | 157 |
src/demo/Makefile
@@ -33,7 +33,7 @@ lib_dir=-L/usr/local/Ascend/ascend-toolkit/6.3.RC1/runtime/lib64 \ | @@ -33,7 +33,7 @@ lib_dir=-L/usr/local/Ascend/ascend-toolkit/6.3.RC1/runtime/lib64 \ | ||
33 | lib=-lacl_dvpp -lascendcl -lacl_dvpp_mpi -lruntime -lascendalog -lc_sec -lmsprofiler -lgert -lmmpa -lascend_hal -lexe_graph -lge_executor -lgraph -lprofapi -lascend_protobuf -lerror_manager -lhybrid_executor -lregister -ldavinci_executor -lge_common -lge_common_base \ | 33 | lib=-lacl_dvpp -lascendcl -lacl_dvpp_mpi -lruntime -lascendalog -lc_sec -lmsprofiler -lgert -lmmpa -lascend_hal -lexe_graph -lge_executor -lgraph -lprofapi -lascend_protobuf -lerror_manager -lhybrid_executor -lregister -ldavinci_executor -lge_common -lge_common_base \ |
34 | -lplatform -lgraph_base -lqos_manager | 34 | -lplatform -lgraph_base -lqos_manager |
35 | 35 | ||
36 | -LIBS= -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lhs_motor_process -lphone_motor_det -lhcp_vdec -latlaslic -lvpt_ascend\ | 36 | +LIBS= -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lhs_motor_process -lphone_motor_det -lhcp_vdec -lmotor_rainshed_vdec -latlaslic -lvpt_ascend\ |
37 | -L $(OPENCV_ROOT)/lib -lopencv_world\ | 37 | -L $(OPENCV_ROOT)/lib -lopencv_world\ |
38 | -L $(JSON_ROOT)/lib -ljsoncpp \ | 38 | -L $(JSON_ROOT)/lib -ljsoncpp \ |
39 | -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ | 39 | -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ |
src/demo/demo.cpp
@@ -172,8 +172,10 @@ void set_task_params(task_param &tparam, const unsigned &idx, const algorithm_ty | @@ -172,8 +172,10 @@ void set_task_params(task_param &tparam, const unsigned &idx, const algorithm_ty | ||
172 | case algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE: { | 172 | case algorithm_type_t::NONMOTOR_VEHICLE_USEPHONE: { |
173 | auto algor_params = new algor_config_param_manned_incident; | 173 | auto algor_params = new algor_config_param_manned_incident; |
174 | { | 174 | { |
175 | - algor_params->m = 8; | ||
176 | - algor_params->n = 10; | 175 | + // algor_params->m = 10; |
176 | + // algor_params->n = 8; | ||
177 | + algor_params->m = 15; | ||
178 | + algor_params->n = 12; | ||
177 | algor_params->obj_confidence_threshold = 0.5f; | 179 | algor_params->obj_confidence_threshold = 0.5f; |
178 | algor_params->obj_min_height = 16; | 180 | algor_params->obj_min_height = 16; |
179 | algor_params->obj_min_width = 64; | 181 | algor_params->obj_min_width = 64; |
@@ -197,8 +199,10 @@ void set_task_params(task_param &tparam, const unsigned &idx, const algorithm_ty | @@ -197,8 +199,10 @@ void set_task_params(task_param &tparam, const unsigned &idx, const algorithm_ty | ||
197 | case algorithm_type_t::NONMOTOR_VEHICLE_REFIT: { | 199 | case algorithm_type_t::NONMOTOR_VEHICLE_REFIT: { |
198 | auto algor_params = new algor_config_param_manned_incident; | 200 | auto algor_params = new algor_config_param_manned_incident; |
199 | { | 201 | { |
200 | - algor_params->m = 10; | ||
201 | - algor_params->n = 8; | 202 | + // algor_params->m = 10; |
203 | + // algor_params->n = 8; | ||
204 | + algor_params->m = 15; | ||
205 | + algor_params->n = 12; | ||
202 | algor_params->obj_confidence_threshold = 0.5f; | 206 | algor_params->obj_confidence_threshold = 0.5f; |
203 | algor_params->obj_min_height = 6; | 207 | algor_params->obj_min_height = 6; |
204 | algor_params->obj_min_width = 32; | 208 | algor_params->obj_min_width = 32; |
src/reprocessing_module/snapshot_reprocessing.cpp
@@ -770,7 +770,7 @@ void snapshot_reprocessing::release_finished_locus_snapshot(const string taskid, | @@ -770,7 +770,7 @@ void snapshot_reprocessing::release_finished_locus_snapshot(const string taskid, | ||
770 | return; | 770 | return; |
771 | } | 771 | } |
772 | 772 | ||
773 | - for(auto ss = total_snapshot_info.begin(); ss != total_snapshot_info.end(); ss++) | 773 | + for(auto ss = total_snapshot_info.begin(); ss != total_snapshot_info.end();) |
774 | { | 774 | { |
775 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) | 775 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) |
776 | { | 776 | { |
@@ -778,10 +778,11 @@ void snapshot_reprocessing::release_finished_locus_snapshot(const string taskid, | @@ -778,10 +778,11 @@ void snapshot_reprocessing::release_finished_locus_snapshot(const string taskid, | ||
778 | VPCUtil::vpc_img_release(ss->second.snapShot); | 778 | VPCUtil::vpc_img_release(ss->second.snapShot); |
779 | VPCUtil::vpc_img_release(ss->second.snapShotLittle); | 779 | VPCUtil::vpc_img_release(ss->second.snapShotLittle); |
780 | } | 780 | } |
781 | - total_snapshot_info.erase(ss); | ||
782 | - return; | 781 | + total_snapshot_info.erase(ss++); |
783 | } | 782 | } |
783 | + else ss++; | ||
784 | } | 784 | } |
785 | + return; | ||
785 | } | 786 | } |
786 | 787 | ||
787 | 788 | ||
@@ -809,7 +810,7 @@ void snapshot_reprocessing::release_village_finished_locus_snapshot(const string | @@ -809,7 +810,7 @@ void snapshot_reprocessing::release_village_finished_locus_snapshot(const string | ||
809 | return; | 810 | return; |
810 | } | 811 | } |
811 | 812 | ||
812 | - for(auto ss = total_village_snapshot_info.begin(); ss != total_village_snapshot_info.end(); ss++) | 813 | + for(auto ss = total_village_snapshot_info.begin(); ss != total_village_snapshot_info.end();) |
813 | { | 814 | { |
814 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) | 815 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) |
815 | { | 816 | { |
@@ -819,10 +820,11 @@ void snapshot_reprocessing::release_village_finished_locus_snapshot(const string | @@ -819,10 +820,11 @@ void snapshot_reprocessing::release_village_finished_locus_snapshot(const string | ||
819 | VPCUtil::vpc_img_release(ss->second.snapShots[i].snapShotLittle); | 820 | VPCUtil::vpc_img_release(ss->second.snapShots[i].snapShotLittle); |
820 | } | 821 | } |
821 | } | 822 | } |
822 | - total_village_snapshot_info.erase(ss); | ||
823 | - return; | 823 | + total_village_snapshot_info.erase(ss++); |
824 | } | 824 | } |
825 | + else ss++; | ||
825 | } | 826 | } |
827 | + return; | ||
826 | } | 828 | } |
827 | 829 | ||
828 | 830 | ||
@@ -851,7 +853,7 @@ void snapshot_reprocessing::release_finished_face_locus_snapshot(const string ta | @@ -851,7 +853,7 @@ void snapshot_reprocessing::release_finished_face_locus_snapshot(const string ta | ||
851 | return; | 853 | return; |
852 | } | 854 | } |
853 | 855 | ||
854 | - for(auto ss = total_face_snapshot_info.begin(); ss != total_face_snapshot_info.end(); ss++) | 856 | + for(auto ss = total_face_snapshot_info.begin(); ss != total_face_snapshot_info.end();) |
855 | { | 857 | { |
856 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) | 858 | if (strcmp(ss->first.video_id.c_str(), taskid.c_str()) == 0) |
857 | { | 859 | { |
@@ -859,8 +861,9 @@ void snapshot_reprocessing::release_finished_face_locus_snapshot(const string ta | @@ -859,8 +861,9 @@ void snapshot_reprocessing::release_finished_face_locus_snapshot(const string ta | ||
859 | VPCUtil::vpc_img_release(ss->second.snapShot); | 861 | VPCUtil::vpc_img_release(ss->second.snapShot); |
860 | VPCUtil::vpc_img_release(ss->second.snapShotLittle); | 862 | VPCUtil::vpc_img_release(ss->second.snapShotLittle); |
861 | } | 863 | } |
862 | - total_face_snapshot_info.erase(ss); | ||
863 | - return; | 864 | + total_face_snapshot_info.erase(ss++); |
864 | } | 865 | } |
866 | + else ss++; | ||
865 | } | 867 | } |
868 | + return; | ||
866 | } | 869 | } |
867 | \ No newline at end of file | 870 | \ No newline at end of file |