From 27f0a463868bdf975ad25799fc3260c9abc2c847 Mon Sep 17 00:00:00 2001 From: Zhao Shuaihua Date: Tue, 17 Oct 2023 08:36:40 +0000 Subject: [PATCH] 玩手机模型升级 货车载人增加关键点辅助 --- bin/libvehicle_pose_vdec.so | Bin 0 -> 103136 bytes bin/models/village/motor_phone1013_310p.om | Bin 0 -> 23464332 bytes bin/models/village/vpose_310p.om | Bin 0 -> 25071657 bytes src/Makefile | 2 +- src/ai_engine_module/motocycle_phone_process.cpp | 3 ++- src/ai_engine_module/motocycle_refit_phone_process.cpp | 3 ++- src/ai_engine_module/truck_manned_process.cpp | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- src/ai_engine_module/truck_manned_process.h | 11 +++++++++-- src/ai_engine_module/vehicle_pose.h | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/demo/Makefile | 2 +- 10 files changed, 302 insertions(+), 26 deletions(-) create mode 100755 bin/libvehicle_pose_vdec.so create mode 100644 bin/models/village/motor_phone1013_310p.om create mode 100644 bin/models/village/vpose_310p.om create mode 100644 src/ai_engine_module/vehicle_pose.h diff --git a/bin/libvehicle_pose_vdec.so b/bin/libvehicle_pose_vdec.so new file mode 100755 index 0000000..98d8bc7 Binary files /dev/null and b/bin/libvehicle_pose_vdec.so differ diff --git a/bin/models/village/motor_phone1013_310p.om b/bin/models/village/motor_phone1013_310p.om new file mode 100644 index 0000000..23150ba Binary files /dev/null and b/bin/models/village/motor_phone1013_310p.om differ diff --git a/bin/models/village/vpose_310p.om b/bin/models/village/vpose_310p.om new file mode 100644 index 0000000..2852283 Binary files /dev/null and b/bin/models/village/vpose_310p.om differ diff --git a/src/Makefile b/src/Makefile index 67cf626..c6a9e7c 100755 --- a/src/Makefile +++ b/src/Makefile @@ -38,7 +38,7 @@ lib=-lacl_dvpp -lascendcl -lacl_dvpp_mpi -lruntime -lascendalog -lc_sec -lmsprof -lplatform -lgraph_base -lqos_manager LIBS= -L $(SPDLOG_ROOT)/lib -l:libspdlog.a \ - -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lphone_motor_det -lhcp_vdec -lmotor_rainshed_vdec -ltraffic_light_vdec -lhs_motor_process\ + -L $(DEPEND_DIR) -lvpt_det_vdec -lsycheck -lface_det_vdec -lhs_tri_process -lhs_truck_process -lphone_motor_det -lhcp_vdec -lmotor_rainshed_vdec -ltraffic_light_vdec -lvehicle_pose_vdec -lhs_motor_process\ -L $(OPENCV_ROOT)/lib -lopencv_world\ -L $(JSON_ROOT)/lib -ljsoncpp \ -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ diff --git a/src/ai_engine_module/motocycle_phone_process.cpp b/src/ai_engine_module/motocycle_phone_process.cpp index 9a1fee1..370b76b 100644 --- a/src/ai_engine_module/motocycle_phone_process.cpp +++ b/src/ai_engine_module/motocycle_phone_process.cpp @@ -84,7 +84,8 @@ namespace ai_engine_module { init_ = false; - string model_path = models_dir + "/models/village/motor_phone_310p.om" ; + // string model_path = models_dir + "/models/village/motor_phone_310p.om" ; + string model_path = models_dir + "/models/village/motor_phone1013_310p.om" ; LOG_INFO("motor_phone 版本:{} 模型路径:{}", motor_phone_getversion(), model_path); motor_phone_param param; diff --git a/src/ai_engine_module/motocycle_refit_phone_process.cpp b/src/ai_engine_module/motocycle_refit_phone_process.cpp index 481a803..55a814f 100644 --- a/src/ai_engine_module/motocycle_refit_phone_process.cpp +++ b/src/ai_engine_module/motocycle_refit_phone_process.cpp @@ -89,7 +89,8 @@ namespace ai_engine_module { init_ = false; - string model_phone_path = models_dir + "/models/village/motor_phone_310p.om" ; + // string model_phone_path = models_dir + "/models/village/motor_phone_310p.om" ; + string model_phone_path = models_dir + "/models/village/motor_phone1013_310p.om" ; string model_hcp_path = models_dir + "/models/village/hcp211008_310p.om" ; LOG_INFO("motor_phone 版本:{} 模型路径:{} hcp 版本:{} 模型路径:{}", motor_phone_getversion(), model_phone_path, hcp_get_version(), model_hcp_path); diff --git a/src/ai_engine_module/truck_manned_process.cpp b/src/ai_engine_module/truck_manned_process.cpp index 91f6348..10be529 100644 --- a/src/ai_engine_module/truck_manned_process.cpp +++ b/src/ai_engine_module/truck_manned_process.cpp @@ -5,6 +5,9 @@ #include "../common/logger.hpp" #include "../ai_platform/mvpt_process_assist.h" +#include "opencv2/opencv.hpp" +#include "opencv2/imgcodecs/legacy/constants_c.h" + namespace ai_engine_module { @@ -25,15 +28,34 @@ namespace ai_engine_module float area_b = float(right - left) * float(bottom - top); float area_intersection = float(x2_intersection - x1_intersection) * float(y2_intersection - y1_intersection); - if (area_a > area_b || area_a <= 0) continue; //暂不考虑非机动车目标比货车大的情况 + if (area_a > area_b || area_a <= 0) continue; //暂不考虑行人及非机动车目标比货车大的情况 // float iou = area_intersection / (area_a + area_b - area_intersection); - float small_overlap_ratio = area_intersection / area_a; //计算非机动车目标相对于自身的重叠程度 + float small_overlap_ratio = area_intersection / area_a; //计算行人及非机动车目标相对于自身的重叠程度 if (small_overlap_ratio > 0.2) legal_person_motocycle_count ++; } return legal_person_motocycle_count; } + void vpose_transform(float pt_x, float pt_y, float center_x, float center_y, float llength, int invert, int *res) { + //Transform pixel location to different reference. + float tmp = float(IMG_RES) / llength; + float t00 = tmp, t11 = tmp; + float t02 = IMG_RES * (-center_x / llength + .5); + float t12 = IMG_RES * (-center_y / llength + .5); + cv::Mat t = (cv::Mat_(3,3) << t00,0,t02,0,t11,t12,0,0,1); + cv::Mat invt = (cv::Mat_(3,3) << 0,0,0,0,0,0,0,0,0); + if (invert) + cv::invert(t, invt); + + cv::Mat new_pt = (cv::Mat_(3,1) << pt_x-1, pt_y-1, 1.); + cv::Mat arr_new = invt * new_pt; + + for (int i = 0; i < 3-1; i++) { + res[i] = int(arr_new.at(i,0)); + } + } + TruckMannedProcess::TruckMannedProcess() : task_param_manager_(nullptr) { @@ -42,9 +64,13 @@ namespace ai_engine_module TruckMannedProcess::~TruckMannedProcess() { - if (tools_) { - hs_truck_release(&tools_); - tools_ = nullptr; + if (hs_tools_) { + hs_truck_release(&hs_tools_); + hs_tools_ = nullptr; + } + if (vpose_tools_) { + vehicle_pose_release(&vpose_tools_); + vpose_tools_ = nullptr; } if (m_algorthim_ctx) { aclrtDestroyContext(m_algorthim_ctx); @@ -57,6 +83,8 @@ namespace ai_engine_module string model_path = models_dir + "/models/hs/hs_truck_310p.om" ; LOG_INFO("hs_truck 版本:{} 模型路径:{}", hs_truck_getversion(), model_path); + string model_vpose_path = models_dir + "/models/village/vpose_310p.om" ; + LOG_INFO("vpose 版本:{} 模型路径:{}", vehicle_pose_get_version(), model_vpose_path); hs_truck_param param; char modelNames[100]; @@ -64,14 +92,23 @@ namespace ai_engine_module param.modelNames = modelNames; param.thresld = 0.25; param.devId = gpu_id; + + vehicle_pose_param vparam; + char vpose_modelNames[100]; + strcpy(vpose_modelNames, model_vpose_path.c_str()); + vparam.modelNames = vpose_modelNames; + vparam.ldmk_thres = 0.0; + vparam.devId = gpu_id; - m_devId = param.devId; + m_devId = gpu_id; ACL_CALL(aclrtSetDevice(m_devId), ACL_SUCCESS, -1); ACL_CALL(aclrtCreateContext(&m_algorthim_ctx, m_devId), ACL_SUCCESS, -1); - + int status; - if (!(init_ = (0 == (status = hs_truck_init(&tools_, param))))) + if (!(init_ = (0 == (status = hs_truck_init(&hs_tools_, param))))) LOG_ERROR("Init TruckMannedProcessSdk failed error code is {}", status); + else if (!(init_ = (0 == (status = vehicle_pose_init(&vpose_tools_, vparam))))) + LOG_ERROR("Init VehiclePoseProcessSdk failed error code is {}", status); else if (!task_param_manager_) task_param_manager_ = task_param_manager::getInstance(); @@ -139,6 +176,8 @@ namespace ai_engine_module auto taskId_iter = taskIds.begin(); std::vector flattened_imgs(0); std::vector flattened_vpc_imgs(0); + std::vector flattened_vpose_imgs(0); + std::vector flattened_vpc_vpose_imgs(0); std::vector flattened_interest_data(0); // VPCUtil* pVpcUtil = VPCUtil::getInstance(); for (int n = 0; n < n_images; ++n) @@ -206,27 +245,44 @@ namespace ai_engine_module //统计货车检测框内行人及非机动车的数量 int person_motocycle_inarea = legal_person_motocycle_inarea(person_motocycle_data, left, top, right, bottom); - - data.box.top = top; data.box.left = left; - data.box.right = right; data.box.bottom = bottom; + //vpose========================================================================================================= + int x_center = round(float((right + left))/2); + int y_center = round(float((bottom + top))/2); + float llength = std::max(right -left, bottom - top); + + // Crop image according to the supplied bounding box. + int ul[2]={0}; int br[2]={0}; + vpose_transform(1, 1, x_center, y_center, llength, 1, ul); // Upper left point + vpose_transform(IMG_RES+1, IMG_RES+1, x_center, y_center, llength, 1, br); // Bottom right point + + int vpose_left = std::max(-ul[0],0); int vpose_top = std::max(-ul[1],0); + int vpose_right = std::min(br[0], src_img_w) - ul[0]; + int vpose_bottom = std::min(br[1], src_img_h) - ul[1]; + int vpose_width = vpose_right - vpose_left; + int vpose_height = vpose_bottom - vpose_top; + if (vpose_width != vpose_height) continue; // 宽高不相等说明处于边缘位置,不处理 + //============================================================================================================= + + data.box.top = top; data.box.left = left; + data.box.right = right; data.box.bottom = bottom; data.box.score = box.confidence; - data.taskId = taskId; data.objId = box.id; + data.taskId = taskId; data.objId = box.id; data.id = obj_key_t{ box.id, taskId, algorithm_type_t::TRUCK_MANNED }; data.person_motocycle_cnt = person_motocycle_inarea; + data.vpose_box.top = vpose_top; data.vpose_box.left = vpose_left; + data.vpose_box.right = vpose_right; data.vpose_box.bottom = vpose_bottom; + data.x_center = x_center; data.y_center = y_center; data.llength = llength; // 抠图 video_object_info obj; strcpy(obj.task_id, taskId.c_str()); obj.object_id = box.id; - obj.left = left; obj.top = top; - obj.right = right; obj.bottom = bottom; + obj.left = left; obj.top = top; obj.right = right; obj.bottom = bottom; vpc_img_info img_info = pVpcUtil->crop(src_img, obj); sy_img img; - img.w_ = width; - img.h_ = height; - img.c_ = src_img->getChannel(); + img.w_ = width; img.h_ = height; img.c_ = src_img->getChannel(); if (img_info.pic_desc != nullptr) { void *outputDataDev = acldvppGetPicDescData(img_info.pic_desc); @@ -237,9 +293,33 @@ namespace ai_engine_module src_img_w, src_img_h, data.box.left, data.box.top, data.box.right, data.box.bottom); continue; } + + // vpose抠图 + video_object_info vpose_obj; + strcpy(vpose_obj.task_id, taskId.c_str()); + vpose_obj.object_id = box.id; + vpose_obj.left = vpose_left; vpose_obj.top = vpose_top; vpose_obj.right = vpose_right; vpose_obj.bottom = vpose_bottom; + + vpc_img_info vpose_img_info = pVpcUtil->crop(src_img, vpose_obj); + + sy_img vpose_img; + vpose_img.w_ = vpose_width; vpose_img.h_ = vpose_height; vpose_img.c_ = src_img->getChannel(); + + if (vpose_img_info.pic_desc != nullptr) { + void *outputDataDev = acldvppGetPicDescData(vpose_img_info.pic_desc); + vpose_img.data_ = reinterpret_cast(outputDataDev); + } + else { + LOG_ERROR("Crop image NPU failed wh is [{}, {}] ltrb is [{} {} {} {}]", + src_img_w, src_img_h, data.vpose_box.left, data.vpose_box.top, data.vpose_box.right, data.vpose_box.bottom); + VPCUtil::vpc_img_release(img_info); + continue; + } flattened_imgs.emplace_back(std::move(img)); flattened_vpc_imgs.emplace_back(std::move(img_info)); + flattened_vpose_imgs.emplace_back(std::move(vpose_img)); //vpose + flattened_vpc_vpose_imgs.emplace_back(std::move(vpose_img_info)); //vpose flattened_interest_data.emplace_back(std::move(data)); flattened_idx_to_batch_idx[flattened_idx++] = n; } @@ -255,13 +335,15 @@ namespace ai_engine_module /* 2. collection result. */ int n_input_image = flattened_imgs.size(); hs_truck_result model_results[n_input_image]; + vehicle_pose_result vpose_results[n_input_image]; { int steps = (n_input_image + MAX_BATCH - 1) / MAX_BATCH; for (int step = 0; step < steps; ++step) { int offset = step * MAX_BATCH; int batch_size = (step == steps - 1) ? n_input_image - offset : MAX_BATCH; - hs_truck_process_batch(tools_, flattened_imgs.data() + offset, batch_size, model_results + offset); + hs_truck_process_batch(hs_tools_, flattened_imgs.data() + offset, batch_size, model_results + offset); + vehicle_pose_batch(vpose_tools_, flattened_vpose_imgs.data() + offset, batch_size, vpose_results + offset); } } @@ -275,6 +357,8 @@ namespace ai_engine_module { VPCUtil::vpc_img_release(flattened_vpc_imgs[n]); //flattened_imgs[n].data_ flattened_imgs[n].data_ = nullptr; + VPCUtil::vpc_img_release(flattened_vpc_vpose_imgs[n]); + flattened_vpose_imgs[n].data_ = nullptr; continue; } @@ -286,6 +370,8 @@ namespace ai_engine_module LOG_ERROR("{} nullptr when get algor param from task_param", det_result.taskId.c_str()); VPCUtil::vpc_img_release(flattened_vpc_imgs[n]); //flattened_imgs[n].data_ flattened_imgs[n].data_ = nullptr; + VPCUtil::vpc_img_release(flattened_vpc_vpose_imgs[n]); + flattened_vpose_imgs[n].data_ = nullptr; continue; } @@ -298,8 +384,38 @@ namespace ai_engine_module auto& e = id_to_mn_[obj_key]; ++e.m_frame; + //vpose=========================================================== + auto &vpose_result = vpose_results[n]; // vpose + int ldmk_x1 = src_img->getWidth(), ldmk_y1 = src_img->getHeight(), ldmk_x2 = 0, ldmk_y2 = 0; + for (int p = 0; p < LDMK_COUNT; p++) { + int ul[2]={0}; + // 映射到大图 + vpose_transform(vpose_result.vehicle_ldmk[p].x_-1, vpose_result.vehicle_ldmk[p].y_-1, det_result.x_center, det_result.y_center, det_result.llength, 1, ul); + + ldmk_x1 = std::min(ul[0] + 1, ldmk_x1); + ldmk_y1 = std::min(ul[1] + 1, ldmk_y1); + ldmk_x2 = std::max(ul[0] + 1, ldmk_x2); + ldmk_y2 = std::max(ul[1] + 1, ldmk_y2); + } + // 统计关键点映射出的四边形中的头肩数量 + int hs_inpose_count = 0; + if (ldmk_x2 > ldmk_x1 && ldmk_y2 > ldmk_y1) { + for (int i = 0; i < model_results[n].objcount; i++) { + int x1_intersection = std::max(det_result.box.left + model_results[n].objinfo[i].left, ldmk_x1); + int y1_intersection = std::max(det_result.box.top + model_results[n].objinfo[i].top, ldmk_y1); + int x2_intersection = std::min(det_result.box.left + model_results[n].objinfo[i].right, ldmk_x2); + int y2_intersection = std::min(det_result.box.top + model_results[n].objinfo[i].bottom, ldmk_y2); + if (x2_intersection <= x1_intersection || y2_intersection <= y1_intersection) continue; // 没有交集 + hs_inpose_count ++; + } + + } + //================================================================= + // if (hs_count >= algor_param->hs_count_threshold) - if (hs_count - det_result.person_motocycle_cnt >= algor_param->hs_count_threshold) //头肩数量去除包含的行人和非机动车数量 + LOG_INFO("hs_count:{} hs_inpose_count: {} person_motocycle_cnt:{} threshold: {}", hs_count, hs_inpose_count, det_result.person_motocycle_cnt, algor_param->hs_count_threshold); + // if (hs_count - det_result.person_motocycle_cnt >= algor_param->hs_count_threshold) //头肩数量去除包含的行人和非机动车数量 + if (hs_count - det_result.person_motocycle_cnt >= algor_param->hs_count_threshold || hs_inpose_count >= algor_param->hs_count_threshold) { if (++e.n_frame == algor_param->n) { @@ -325,7 +441,7 @@ namespace ai_engine_module VPCUtil::vpc_img_release(flattened_vpc_imgs[n]); //flattened_imgs[n].data_ _continue: { - + VPCUtil::vpc_img_release(flattened_vpc_vpose_imgs[n]); } } diff --git a/src/ai_engine_module/truck_manned_process.h b/src/ai_engine_module/truck_manned_process.h index 234491a..b624350 100644 --- a/src/ai_engine_module/truck_manned_process.h +++ b/src/ai_engine_module/truck_manned_process.h @@ -8,6 +8,7 @@ #include "../ai_platform/macro_definition.h" #include "ai_engine_header.h" #include "hs_det_truck.h" +#include "vehicle_pose.h" #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" @@ -23,6 +24,7 @@ namespace ai_engine_module using id_t = obj_key_t; using task_id_t = std::string; using algor_param_type = algor_config_param_manned_incident*; + #define IMG_RES 224 typedef struct input_data_wrap_t { @@ -30,7 +32,11 @@ namespace ai_engine_module long objId; int person_motocycle_cnt; std::string taskId; - box_t box; + box_t box; // 记录检测框 + box_t vpose_box; // 记录预处理后的检测框 + int x_center; // 外扩前的中心点及长边信息 + int y_center; + float llength; } input_data_wrap_t; @@ -91,7 +97,8 @@ namespace ai_engine_module aclrtContext m_algorthim_ctx; bool init_; - void* tools_; + void* hs_tools_; + void* vpose_tools_; task_param_manager* task_param_manager_; std::map id_to_mn_; std::map id_to_result_; diff --git a/src/ai_engine_module/vehicle_pose.h b/src/ai_engine_module/vehicle_pose.h new file mode 100644 index 0000000..13a743c --- /dev/null +++ b/src/ai_engine_module/vehicle_pose.h @@ -0,0 +1,151 @@ +/******************************************************************************************* +* Version: car_pose_v0.0.0.20210519 +* CopyRight: 中科视语(北京)科技有限公司 +* UpdateDate: 20210519 +* Content: 车辆姿态估计 +********************************************************************************************/ + +#ifndef _VEHICLE_POSE_H_ +#define _VEHICLE_POSE_H_ + +#ifdef _MSC_VER +#ifdef VEHICLE_POSE_EXPORTS +#define VEHICLE_POSE_API __declspec(dllexport) +#else +#define VEHICLE_POSE_API __declspec(dllimport) +#endif +#else +#define VEHICLE_POSE_API __attribute__ ((visibility ("default"))) //? +#endif + +#include "sy_common.h" + +#define MAX_OBJ_COUNT 200 + +//#define _VEHICLE_DET_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define POSE_COUNT 9 +// #define LDMK_COUNT 20 +#define LDMK_COUNT 32 //221104版本有32个关键点 + +#ifndef __VEHICLE_POSE_RESULT__ +#define __VEHICLE_POSE_RESULT__ + typedef struct vehicle_pose_result + { + sy_point vehicle_ldmk[LDMK_COUNT]; + float vehicle_ldmk_score[LDMK_COUNT]; + float vehicle_pose[POSE_COUNT]; + + double phi; + double gamma; + double theta; + }vehicle_pose_result; +#endif + +#ifndef __VEHICLE_POSE_PARAM__ +#define __VEHICLE_POSE_PARAM__ + typedef struct vehicle_pose_param + { + // int mode; /运行模式(DEVICE_GPU / DEVICE_CPU) + int devId; //运行卡号 + char* modelNames; + float ldmk_thres; //ldmk点的阈值 + // int engine; //指定运行引擎(ENGINE_MCAFFE2 / ENGINE_TENSORRT) + // int max_batch; //指定trt批处理数量上限 + // char* serialize_file; //指定trt缓存文件完整路径 + // char* auth_license; + // vehicle_pose_param() :mode(DEVICE_GPU), gpuid(0), engine(ENGINE_TENSORRT), max_batch(20), auth_license("sy") {}; + }vehicle_pose_param; +#endif + + +#ifndef __VEHICLE_POSE_DRAW_PARAM__ +#define __VEHICLE_POSE_DRAW_PARAM__ +#define PIXEL_COUNT 3 + typedef struct vehicle_pose_draw_param + { + int ldmk[PIXEL_COUNT]; //绘制ldmk点 像素值 + int pose[PIXEL_COUNT]; //绘制点云 像素值 + + char* result_image_path; //图片保存路径,如"./result/car1.jpg" + char* car_vertice_path; //car_vertice路径 + + }vehicle_pose_draw_param; +#endif + + + /************************************************************************* + * FUNCTION: car_pose_recg_init + * PURPOSE: 车辆姿态估计初始化 + * PARAM: + [in] handle - 句柄 + [in] param - 初始化参数 + * RETURN: 成功(0)或错误(<0) + * NOTES: + *************************************************************************/ + VEHICLE_POSE_API int vehicle_pose_init(void ** handle, vehicle_pose_param param); + + + /************************************************************************* + * FUNCTION: car_pose_recg_process + * PURPOSE: 车辆姿态估计 + * PARAM: + [in] tools - 句柄 + [in] img_data - 检测图像数据 + [out] result - 检测结果 + * RETURN: 成功(0)或错误(<0) + * NOTES: + *************************************************************************/ + VEHICLE_POSE_API int vehicle_pose_process(void * handle, sy_img * img_data, vehicle_pose_result * result); + + + /************************************************************************* + * FUNCTION: car_pose_recg_batch + * PURPOSE: 车辆姿态估计批处理 + * PARAM: + [in] tools - 句柄 + [in] img_data_array - 检测图像数据数组 + [in] batch_size - 检测图像批处理个数 + [out] result - 检测结果数组 + * RETURN: 成功(0)或错误(<0) + * NOTES: + *************************************************************************/ + VEHICLE_POSE_API int vehicle_pose_batch(void * handle, sy_img *img_data_array, int batch_size, vehicle_pose_result * result); + + VEHICLE_POSE_API int vehicle_pose_batch_draw(void * handle, sy_img *img_data_array, int batch_size, vehicle_pose_result * result, vehicle_pose_draw_param *draw_param); + +#ifdef _VEHICLE_DET_ + VEHICLE_POSE_API int vehicle_det_pose_process_path(void * handle, char* image_path, vehicle_pose_result *result, int *car_count, vehicle_pose_draw_param draw_param); + VEHICLE_POSE_API int vehicle_det_pose_process(void * handle, sy_img img_data, vehicle_pose_result *result,int *car_count, vehicle_pose_draw_param draw_param); + #endif + /************************************************************************* + * FUNCTION: car_pose_recg_release + * PURPOSE: 资源释放 + * PARAM: + [in] handle - 处理句柄 + * RETURN: NULL + * NOTES: + *************************************************************************/ + VEHICLE_POSE_API void vehicle_pose_release(void ** handle); + + + /************************************************************************* + * FUNCTION: car_pose_recg_get_version + * PURPOSE: 版本返回 + * PARAM: NULL + * RETURN: 版本号 + + * NOTES: + *************************************************************************/ + VEHICLE_POSE_API const char * vehicle_pose_get_version(); + + +#ifdef __cplusplus +}; +#endif +#endif diff --git a/src/demo/Makefile b/src/demo/Makefile index 5639d8c..5f2477c 100755 --- a/src/demo/Makefile +++ b/src/demo/Makefile @@ -33,7 +33,7 @@ lib_dir=-L/usr/local/Ascend/ascend-toolkit/6.3.RC1/runtime/lib64 \ 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 \ -lplatform -lgraph_base -lqos_manager -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 -ltraffic_light_vdec -latlaslic -lvpt_ascend\ +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 -ltraffic_light_vdec -lvehicle_pose_vdec -latlaslic -lvpt_ascend\ -L $(OPENCV_ROOT)/lib -lopencv_world\ -L $(JSON_ROOT)/lib -ljsoncpp \ -L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \ -- libgit2 0.21.4