From ecb47d89dcb2b1d8e4be9b6cb0a84d8b49e2e3cc Mon Sep 17 00:00:00 2001 From: pansen <pansen626@sina.com> Date: 星期三, 10 四月 2019 12:20:00 +0800 Subject: [PATCH] 添加iceServer --- QiaoJiaSystem/VptServer/CMakeLists.txt | 11 QiaoJiaSystem/VptServer/VptServerI.h | 41 QiaoJiaSystem/VptServer/mainAssist.h | 2 QiaoJiaSystem/VptServer/VptDetectWrapper.cpp | 56 QiaoJiaSystem/VptServer/rpc/gen.sh | 2 QiaoJiaSystem/VptServer/VptServerI.cpp | 155 ++ QiaoJiaSystem/VptServer/rpc/VptServer.ice | 71 + QiaoJiaSystem/build/runAll.sh | 6 QiaoJiaSystem/VptServer/VptDetectWrapper.h | 86 + QiaoJiaSystem/VptServer/main.cpp | 201 +-- QiaoJiaSystem/VptServer/rpc/VptServer.cpp | 851 +++++++++++++++ QiaoJiaSystem/VptServer/rpc/VptServer.h | 1728 ++++++++++++++++++++++++++++++++ 12 files changed, 3,038 insertions(+), 172 deletions(-) diff --git a/QiaoJiaSystem/VptServer/CMakeLists.txt b/QiaoJiaSystem/VptServer/CMakeLists.txt index 6b4a0d4..20bb5fd 100644 --- a/QiaoJiaSystem/VptServer/CMakeLists.txt +++ b/QiaoJiaSystem/VptServer/CMakeLists.txt @@ -33,7 +33,9 @@ #cuda_add_library(${PROJECT_NAME} STATIC ${CURRENT_HEADERS} ${CURRENT_SOURCES}) SET(SOURCES + VptServerI.cpp VptDetectWrapper.cpp + ./rpc/VptServer.cpp # GlobalSignalWaitLock.hpp ) @@ -50,6 +52,8 @@ cuda cudnn + jsoncpp + Qt5Core human_car_parsing human_parsing utools @@ -59,12 +63,15 @@ vpt_det vpt_pic + Ice glog pthread ) include_directories( + ./rpc/ ../../../BasicPlatForm/libs/Vpts/include + ../../../BasicPlatForm/libs/jsoncpp/include #glog ../../../BasicPlatForm/libs/glog/include @@ -75,6 +82,7 @@ ../../../BasicPlatForm/basic/debug/ ../../../BasicPlatForm/ ../../../BasicPlatForm/basic/pipe_element/ffmpeg/ + ../../../BasicPlatForm/libs/Ice-3.7.0/include /usr/include/x86_64-linux-gnu/qt5 @@ -82,9 +90,12 @@ link_directories( ../../../BasicPlatForm/libs/Vpts/lib + ../../../BasicPlatForm/libs/jsoncpp/lib #glog /usr/local/lib/ /usr/local/cuda/lib64/ + ../../../BasicPlatForm/libs/openssl/lib/ + ../../../BasicPlatForm/libs/Ice-3.7.0/lib64 #glog ../../../BasicPlatForm/libs/glog/lib ../../../BasicPlatForm/libs/opencv/lib diff --git a/QiaoJiaSystem/VptServer/VptDetectWrapper.cpp b/QiaoJiaSystem/VptServer/VptDetectWrapper.cpp index 98fbfcb..924e8bd 100644 --- a/QiaoJiaSystem/VptServer/VptDetectWrapper.cpp +++ b/QiaoJiaSystem/VptServer/VptDetectWrapper.cpp @@ -31,7 +31,7 @@ vpt_pic_init(&m_handle, m_param); } -void VptDetectWrapper::process_image(cv::Mat &_img) { +list<VptDetectResults> VptDetectWrapper::process_image(cv::Mat &_img) { m_results.clear(); sy_img img; @@ -70,12 +70,24 @@ result.info[i].obj_rect.width_, result.info[i].obj_rect.height_); } else {} } + //release source + if (result.info != NULL) { + for (int i = 0; i < MAX_DET_COUNT; i++) { + if (result.info[i].analysis_res != NULL) { + delete result.info[i].analysis_res; + result.info[i].analysis_res = NULL; + } + } + delete[] result.info; + result.info = NULL; + } DBG(m_results.size()); + return m_results; } VptDetectResults VptDetectWrapper::changeAnalysisRes(int index, void *result) { - VptDetectResults vptDetectResults; + VptDetectResults vptDetectResults(index); vptDetectResults.sdkDetectType = static_cast<SDKDetectType>(index); // vptDetectResults.vptDetectRes.carDetectRes; switch (vptDetectResults.sdkDetectType) { @@ -87,7 +99,7 @@ for (int i = 0; i < HP_FIR_INDEX_SIZE; i++) { int resIndex = vptDetectResults.vptDetectRes.personDetectRes.res_objs[i].res_index; cout << vptDetectResults.vptDetectRes.personDetectRes.res_objs[i].res_prob << " "; - cout << HpResStr[i][resIndex] << " " << endl; + cout << HpResStr[i][resIndex] << " "; } //test code end }; @@ -97,12 +109,14 @@ hcp_res *cur_res = (hcp_res *) result; memcpy(vptDetectResults.vptDetectRes.perRideCarDetectRes.res_objs, cur_res->res_objs, sizeof(classfy_boj_res) * HCP_FIR_INDEX_SIZE); + //test code for (int i = 0; i < HCP_FIR_INDEX_SIZE; i++) { int resIndex = vptDetectResults.vptDetectRes.perRideCarDetectRes.res_objs[i].res_index; cout << vptDetectResults.vptDetectRes.perRideCarDetectRes.res_objs[i].res_prob << " "; - cout << HpResStr[i][resIndex] << " " << endl; + cout << HpResStr[i][resIndex] << " "; } cout << endl << endl; + //test code }; break; case SDKDetectType::car : @@ -118,32 +132,35 @@ // 杞﹀瀷璇嗗埆 if (cur_res->vr_res.vehicle_brand != NULL) { -// cout << " 杞﹁締鍝佺墝 - " << cur_res->vr_res.vehicle_brand << endl; - carRes.vehicle_brand = std::move(string(cur_res->vr_res.vehicle_brand)); + cout << " 杞﹁締鍝佺墝 - " << cur_res->vr_res.vehicle_brand << endl; + carRes.vehicle_brand = cur_res->vr_res.vehicle_brand; +// carRes.vehicle_brand = string(cur_res->vr_res.vehicle_brand); +// carRes.vehicle_brand = "鍙�"; delete[] cur_res->vr_res.vehicle_brand; cur_res->vr_res.vehicle_brand = NULL; } if (cur_res->vr_res.vehicle_subbrand != NULL) { -// cout << " 杞﹁締瀛愬搧鐗� - " << cur_res->vr_res.vehicle_subbrand << endl; - carRes.vehicle_subbrand = std::move(string(cur_res->vr_res.vehicle_subbrand)); + cout << " 杞﹁締瀛愬搧鐗� - " << cur_res->vr_res.vehicle_subbrand << endl; + carRes.vehicle_subbrand = cur_res->vr_res.vehicle_subbrand; +// carRes.vehicle_subbrand = cur_res->vr_res.vehicle_subbrand; delete[] cur_res->vr_res.vehicle_subbrand; cur_res->vr_res.vehicle_subbrand = NULL; } if (cur_res->vr_res.vehicle_issue_year != NULL) { -// cout << " 杞﹁締骞存 - " << cur_res->vr_res.vehicle_issue_year << endl; - carRes.vehicle_issue_year = std::move(string(cur_res->vr_res.vehicle_issue_year)); + cout << " 杞﹁締骞存 - " << cur_res->vr_res.vehicle_issue_year << endl; + carRes.vehicle_issue_year = cur_res->vr_res.vehicle_issue_year; delete[] cur_res->vr_res.vehicle_issue_year; cur_res->vr_res.vehicle_issue_year = NULL; } if (cur_res->vr_res.vehicle_type != NULL) { -// cout << " 杞﹁締绫诲瀷 - " << cur_res->vr_res.vehicle_type << endl; - carRes.vehicle_type = std::move(string(cur_res->vr_res.vehicle_type)); + cout << " 杞﹁締绫诲瀷 - " << cur_res->vr_res.vehicle_type << endl; + carRes.vehicle_type = cur_res->vr_res.vehicle_type; delete[] cur_res->vr_res.vehicle_type; cur_res->vr_res.vehicle_type = NULL; } if (cur_res->vr_res.freight_ton != NULL) { -// cout << " 璐ц溅鍚ㄧ骇 - " << cur_res->vr_res.freight_ton << endl; - carRes.freight_ton = std::move(string(cur_res->vr_res.freight_ton)); + cout << " 璐ц溅鍚ㄧ骇 - " << cur_res->vr_res.freight_ton << endl; + carRes.freight_ton = cur_res->vr_res.freight_ton; delete[] cur_res->vr_res.freight_ton; cur_res->vr_res.freight_ton = NULL; } @@ -152,16 +169,17 @@ // 杞︾墝 if (cur_res->vp_res.rect.height_ != 0 && cur_res->vp_res.rect.width_ != 0) { -// cout << "杞︾墝浣嶇疆: " << cur_res->vp_res.rect.left_ << " " << cur_res->vp_res.rect.top_ << " " -// << cur_res->vp_res.rect.width_ << " " << cur_res->vp_res.rect.height_ << endl; + cout << "杞︾墝浣嶇疆: " << cur_res->vp_res.rect.left_ << " " << cur_res->vp_res.rect.top_ << " " + << cur_res->vp_res.rect.width_ << " " << cur_res->vp_res.rect.height_ << endl; carRes.carPlateRect.setRect(cur_res->vp_res.rect.left_, cur_res->vp_res.rect.top_, cur_res->vp_res.rect.width_, cur_res->vp_res.rect.height_); carRes.carPlateRectScore = cur_res->vp_res.detectScore; - + std::string _carPlate; for (int m = 0; m < 7; m++) { -// printf("%s", cur_res->vp_res.recg[m].character); - carRes.carPlate.append(cur_res->vp_res.recg[m].character); + printf("%s", cur_res->vp_res.recg[m].character); + _carPlate.append(cur_res->vp_res.recg[m].character); } + carRes.carPlate = const_cast<char *>(_carPlate.c_str()); carRes.carPlateRectScore = cur_res->vp_res.numScore; carRes.carPlatetype = cur_res->vp_res.type; // printf(" numScore = %.2f, detectScore = %.2f\n", cur_res->vp_res.numScore, cur_res->vp_res.detectScore); diff --git a/QiaoJiaSystem/VptServer/VptDetectWrapper.h b/QiaoJiaSystem/VptServer/VptDetectWrapper.h index a36ea73..b0b65a8 100644 --- a/QiaoJiaSystem/VptServer/VptDetectWrapper.h +++ b/QiaoJiaSystem/VptServer/VptDetectWrapper.h @@ -63,12 +63,53 @@ }; struct CarDetectRes { + CarDetectRes() : + vehicle_brand(""), + vehicle_subbrand(""), + vehicle_issue_year(""), + vehicle_type(""), freight_ton(""), + vehicle_score(0), colorLabel(static_cast<ColorLabel>(-1)), + colorLabelProb(0), carPlateRect(0, 0, 0, 0), + carPlateRectScore(0), carPlate(""), + carPlateScore(0), carPlatetype(-1) {} + + virtual ~CarDetectRes() { + + } + + CarDetectRes(const CarDetectRes &rhs) { + this->vehicle_brand = rhs.vehicle_brand; //杞﹁締鍝佺墝 + this->vehicle_subbrand = rhs.vehicle_subbrand; //杞﹁締瀛愬搧鐗� + this->vehicle_issue_year = rhs.vehicle_issue_year; //杞﹁締骞存 + this->vehicle_type = rhs.vehicle_type; //杞﹁締绫诲瀷 + this->freight_ton = rhs.freight_ton; //璐ц溅鍚ㄧ骇 + this->vehicle_score = rhs.vehicle_score; //杞﹀瀷璇嗗埆缃俊搴� + + //杞﹂鑹茶瘑鍒粨鏋� + this->colorLabel = rhs.colorLabel; //杞﹂鑹� + this->colorLabelProb = rhs.colorLabelProb; //杞﹂鑹茬疆淇″害 + + //杞︾墝妫�娴嬬粨鏋� + this->carPlateRect = rhs.carPlateRect; //杞︾墝鍖哄煙 + this->carPlateRectScore = rhs.carPlateRectScore; //杞︾墝鍖哄煙缃俊搴� + this->carPlate = rhs.carPlate; //杞︾墝 + this->carPlateScore = rhs.carPlateScore; //杞︾墝缃俊搴� + this->carPlatetype = rhs.carPlatetype; + } + + +// //杞﹀瀷璇嗗埆缁撴灉 +// std::string vehicle_brand; //杞﹁締鍝佺墝 +// std::string vehicle_subbrand; //杞﹁締瀛愬搧鐗� +// std::string vehicle_issue_year; //杞﹁締骞存 +// std::string vehicle_type; //杞﹁締绫诲瀷 +// std::string freight_ton; //璐ц溅鍚ㄧ骇 //杞﹀瀷璇嗗埆缁撴灉 - std::string vehicle_brand; //杞﹁締鍝佺墝 - std::string vehicle_subbrand; //杞﹁締瀛愬搧鐗� - std::string vehicle_issue_year; //杞﹁締骞存 - std::string vehicle_type; //杞﹁締绫诲瀷 - std::string freight_ton; //璐ц溅鍚ㄧ骇 + char *vehicle_brand; //杞﹁締鍝佺墝 + char *vehicle_subbrand; //杞﹁締瀛愬搧鐗� + char *vehicle_issue_year; //杞﹁締骞存 + char *vehicle_type; //杞﹁締绫诲瀷 + char *freight_ton; //璐ц溅鍚ㄧ骇 float vehicle_score; //杞﹀瀷璇嗗埆缃俊搴� //杞﹂鑹茶瘑鍒粨鏋� @@ -78,29 +119,43 @@ //杞︾墝妫�娴嬬粨鏋� BskRect carPlateRect; //杞︾墝鍖哄煙 float carPlateRectScore; //杞︾墝鍖哄煙缃俊搴� - std::string carPlate; //杞︾墝 +// std::string carPlate; //杞︾墝 + char *carPlate; //杞︾墝 float carPlateScore; //杞︾墝缃俊搴� int carPlatetype; }; union VPTDetectRes { - struct TestVPTDetectRes { - int i; - }; + VPTDetectRes() { - VPTDetectRes() : testVPTDetectRes(TestVPTDetectRes()) { + } + VPTDetectRes(int i) { + switch (i) { + case 0 : + personDetectRes.res_objs; + break; + case 1: + case 2 : + perRideCarDetectRes.res_objs; + break; + case 4 : + case 5 : + case 6 : + case 8 : + carDetectRes.carPlatetype = -1; + break; + } } ~VPTDetectRes() { } - TestVPTDetectRes testVPTDetectRes; + CarDetectRes carDetectRes; PersonDetectRes personDetectRes; PerRideCarDetectRes perRideCarDetectRes; - CarDetectRes carDetectRes; }; enum class SDKDetectType { @@ -119,6 +174,8 @@ struct VptDetectResults { public: VptDetectResults() {} + + VptDetectResults(int _idx) : vptDetectRes(_idx) {} virtual ~VptDetectResults() {} @@ -144,8 +201,8 @@ } } - SDKDetectType sdkDetectType; VPTDetectRes vptDetectRes; + SDKDetectType sdkDetectType; BskRect bskRect; }; @@ -157,8 +214,7 @@ virtual ~VptDetectWrapper(); - - void process_image(cv::Mat &_img); + list<VptDetectResults> process_image(cv::Mat &_img); private: diff --git a/QiaoJiaSystem/VptServer/VptServerI.cpp b/QiaoJiaSystem/VptServer/VptServerI.cpp new file mode 100644 index 0000000..c8b3361 --- /dev/null +++ b/QiaoJiaSystem/VptServer/VptServerI.cpp @@ -0,0 +1,155 @@ +// +// Created by ps on 19-4-10. +// + +#include "VptServerI.h" +#include <QtCore/QString> +#include <QtCore/QSharedMemory> + +VptServerI::VptServerI() {} + +VptServerI::~VptServerI() { + +} + +VptDetect::ObjInfos +VptServerI::VptDetect(Ice::Int width, Ice::Int height, const ::std::string &shM, + const ::Ice::Current ¤t) { + + VptDetect::ObjInfos objInfos; + QSharedMemory shareMemory(QString(shM.c_str())); + if (shareMemory.attach()) { + int channel = 3; + cv::Mat _mat = bufferToMat(width, height, channel, shareMemory.constData()); + auto res = std::move(m_vptDetectWrapper.process_image(_mat)); + + for (auto &item : res) { + ::VptDetect::VptDetectResult vptDetectResult; + + vptDetectResult.sdkDetectType = static_cast<Ice::Int>(item.sdkDetectType); + + vptDetectResult.bskRect.left = item.bskRect.left_; + vptDetectResult.bskRect.top = item.bskRect.top_; + vptDetectResult.bskRect.width = item.bskRect.width_; + vptDetectResult.bskRect.height = item.bskRect.height_; + + switch (vptDetectResult.sdkDetectType) { + case 0 : { + vptDetectResult.personDetectRes.res_objs.resize(HP_FIR_INDEX_SIZE); + memcpy(vptDetectResult.personDetectRes.res_objs.data(), item.vptDetectRes.personDetectRes.res_objs, + sizeof(classfy_boj_res) * HP_FIR_INDEX_SIZE); + }; + break; + case 1: + case 2 : { + vptDetectResult.perRideCarDetectRes.res_objs.resize(HCP_FIR_INDEX_SIZE); + memcpy(vptDetectResult.perRideCarDetectRes.res_objs.data(), + item.vptDetectRes.perRideCarDetectRes.res_objs, + sizeof(classfy_boj_res) * HCP_FIR_INDEX_SIZE); + }; + break; + case 4 : + case 5 : + case 6 : + case 8 : { + //#todo + vptDetectResult.carDetectRes; + }; + break; + } + objInfos.push_back(vptDetectResult); + } + + } + return objInfos; +} + +VptDetect::stringDatas VptServerI::getStr(Ice::Int type_, const ::Ice::Current ¤t) { + VptDetect::stringDatas res; + //#todo extern to func + switch (type_) { + case 0 : { + for (auto &items : HpResStr) { + ::VptDetect::stringData stringData; + for (auto &item : items) { + stringData.push_back(item); + } + res.push_back(std::move(stringData)); + } + }; + break; + case 1 : { + for (auto &items : HcpResStr) { + ::VptDetect::stringData stringData; + for (auto &item : items) { + stringData.push_back(item); + } + res.push_back(std::move(stringData)); + } + }; + break; + case 2 : { + ::VptDetect::stringData stringData; + for (auto &item : type) { + stringData.push_back(item); + } + res.push_back(std::move(stringData)); + }; + break; + case 3 : { + ::VptDetect::stringData stringData; + for (auto &item : colorLabelStr) { + stringData.push_back(item); + } + res.push_back(std::move(stringData)); + }; + break; + } + return res; +} + +VptDetect::stringData VptServerI::getTypeStr(const ::Ice::Current ¤t) { + //#todo + return VptDetect::stringData(); +} + +VptDetect::stringData VptServerI::getColorLabel(const ::Ice::Current ¤t) { + //#todo + return VptDetect::stringData(); +} + +VptDetect::stringDatas VptServerI::getHpResStr(const ::Ice::Current ¤t) { + //#todo + return VptDetect::stringDatas(); +} + +VptDetect::stringDatas VptServerI::getHcpResStr(const ::Ice::Current ¤t) { + //#todo + return VptDetect::stringDatas(); +} + +cv::Mat VptServerI::bufferToMat(const int w, const int h, const int channels, const void *buffer) { + int nType = -1; + switch (channels) { + case 1: { + nType = CV_8UC1; + break; + } + case 2: { + nType = CV_8UC2; + break; + } + case 3: { + nType = CV_8UC3; + break; + } + default: { + nType = CV_8UC3; + break; + } + } + cv::Mat mat(h, w, nType, (void *) buffer); + return mat; +} + + diff --git a/QiaoJiaSystem/VptServer/VptServerI.h b/QiaoJiaSystem/VptServer/VptServerI.h new file mode 100644 index 0000000..e6e5e9a --- /dev/null +++ b/QiaoJiaSystem/VptServer/VptServerI.h @@ -0,0 +1,41 @@ +// +// Created by ps on 19-4-10. +// + +#include "VptServer.h" + +#include "VptDetectWrapper.h" + +#ifndef QIAOJIASYSTEM_VPTSERVERI_H +#define QIAOJIASYSTEM_VPTSERVERI_H + + +class VptServerI : public VptDetect::VptDetectServer { +public: + VptServerI(); + + virtual ~VptServerI(); + + VptDetect::ObjInfos + VptDetect(Ice::Int width, Ice::Int height, const ::std::string &shM, + const ::Ice::Current ¤t) override; + + VptDetect::stringDatas getStr(Ice::Int type_, const ::Ice::Current ¤t) override; + + VptDetect::stringData getTypeStr(const ::Ice::Current ¤t) override; + + VptDetect::stringData getColorLabel(const ::Ice::Current ¤t) override; + + VptDetect::stringDatas getHpResStr(const ::Ice::Current ¤t) override; + + VptDetect::stringDatas getHcpResStr(const ::Ice::Current ¤t) override; + +private: + cv::Mat bufferToMat(const int w, const int h, const int channels, const void *buffer); + +private: + VptDetectWrapper m_vptDetectWrapper; +}; + + +#endif //QIAOJIASYSTEM_VPTSERVERI_H diff --git a/QiaoJiaSystem/VptServer/main.cpp b/QiaoJiaSystem/VptServer/main.cpp index 91e0087..16027c8 100644 --- a/QiaoJiaSystem/VptServer/main.cpp +++ b/QiaoJiaSystem/VptServer/main.cpp @@ -12,16 +12,50 @@ #else #include <sys/time.h> -#include <basic/util/app/AppUtil.h> #endif +#include <basic/util/app/AppUtil.h> +#include "VptDetectWrapper.h" +#include <Ice/Ice.h> +#include <basic/rpc/IceRpc.hpp> +#include <basic/util/app/AppPreference.hpp> +#include "VptServerI.h" +#include <basic/debug/Debug.h> + +#include <basic/util/app/AppConfig.h> + using namespace std; +#define varName(x) #x +#define printExp(exp) cout<<#exp<<"涓�:\t\t"<<(exp)<<endl +#define printExpToString(exp) cout<<(string(#exp)+"涓�:\t\t")<<(exp).toString()<<endl //娉ㄦ剰exp鍔犳嫭鍙锋洿瀹夊叏 - -void printfAnalysisRes(int index, void *result); int main(int argc, char **argv) { + + std::cout << __DATE__ << " " << __TIME__ << std::endl; + SAVE_APP_ARGS; + ENABLEGLOG(GET_STR_CONFIG("logPath").c_str()); + auto ich = Ice::initialize(argc, argv); + + if (argc < 4) { + assert("t_value.size()"); + } + appPref.setIntData("gpu.index", atoi(argv[1])); + appPref.setIntData("RpcVptPort", atoi(argv[2])); + appPref.setFloatData("thresh.detect", atof(argv[3])); + + + IceRpcServer<VptServerI> server("vptServer", appPref.getIntData("RpcVptPort"), "tcp"); + server.setMessageSizeMax(1024 * 1024 * 50); + server.setPoolInitSize(5); + server.setPoolMaxSize(10); + server.runWaitShutDown(); + return 0; +} + + +int main2(int argc, char **argv) { string imgpath; if (argc < 2) { @@ -39,21 +73,8 @@ double fontScale = 1; int thickness = 2; - void *handle; - vptpic_param param; - param.mode = DEVICE_GPU; - param.gpuid = 0; + VptDetectWrapper vptDetectWrapper; - param.hp_recg_config = SY_CONFIG_OPEN; - param.hcp_recg_config = SY_CONFIG_OPEN; - param.vehicle_color_config = SY_CONFIG_OPEN; - param.vehicle_recg_config = SY_CONFIG_OPEN; - param.vehicle_pendant_det_recg_config = SY_CONFIG_OPEN; - - param.dbPath = "CarBodyFeature.db"; - param.log = SY_CONFIG_OPEN; - - vpt_pic_init(&handle, param); cv::VideoCapture capture; capture.open(imgpath); @@ -66,136 +87,46 @@ while (!process_image.empty()) { process_image.copyTo(image); - sy_img img; - img.set_data(image.cols, image.rows, image.channels(), image.data); + vptDetectWrapper.process_image(image); - vptpic_result result; - result.info = new vptobj_info[MAX_DET_COUNT]; - int ret = vpt_pic_process(handle, img, &result); - - for (int i = 0; i < result.count; i++) { - char str_i[100]; - int colorIndex = result.info[i].obj_index; - if (colorIndex < 0 || colorIndex >= 9)continue; - sprintf(str_i, "%s:%.2f", type[colorIndex].c_str(), result.info[i].obj_score); - - rectangle(process_image, - cvPoint(result.info[i].obj_rect.left_ - 5, result.info[i].obj_rect.top_ - 15), - cvPoint(result.info[i].obj_rect.left_ + result.info[i].obj_rect.width_ + 5, - result.info[i].obj_rect.top_ + result.info[i].obj_rect.height_ + 10), - cv::Scalar(color[colorIndex][0], color[colorIndex][1], color[colorIndex][2]), 3, 1); - - cv::putText(process_image, str_i, - cv::Point(result.info[i].obj_rect.left_, result.info[i].obj_rect.top_), - fontFace, fontScale, - cv::Scalar(color[colorIndex][0], color[colorIndex][1], color[colorIndex][2]), thickness, 8); - - //杈撳嚭浜屾灞炴�у垎鏋愮粨鏋� - printfAnalysisRes(colorIndex, result.info[i].analysis_res); - } +// for (int i = 0; i < result.count; i++) { +// char str_i[100]; +// int colorIndex = result.info[i].obj_index; +// if (colorIndex < 0 || colorIndex >= 9)continue; +// sprintf(str_i, "%s:%.2f", type[colorIndex].c_str(), result.info[i].obj_score); +// +// rectangle(process_image, +// cvPoint(result.info[i].obj_rect.left_ - 5, result.info[i].obj_rect.top_ - 15), +// cvPoint(result.info[i].obj_rect.left_ + result.info[i].obj_rect.width_ + 5, +// result.info[i].obj_rect.top_ + result.info[i].obj_rect.height_ + 10), +// cv::Scalar(color[colorIndex][0], color[colorIndex][1], color[colorIndex][2]), 3, 1); +// +// cv::putText(process_image, str_i, +// cv::Point(result.info[i].obj_rect.left_, result.info[i].obj_rect.top_), +// fontFace, fontScale, +// cv::Scalar(color[colorIndex][0], color[colorIndex][1], color[colorIndex][2]), thickness, 8); +// +// //杈撳嚭浜屾灞炴�у垎鏋愮粨鏋� +// printfAnalysisRes(colorIndex, result.info[i].analysis_res); +// } #ifdef _MSC_VER cv::imshow("res", image); cv::waitKey(0); #else - char svpath[1024]; - memset(svpath, 0, sizeof(svpath)); - std::string strNewTime2 = AppUtil::getTimeUSecString(); - strNewTime2.append(".jpg"); - - sprintf(svpath, "vpt_res/%s", strNewTime2.c_str()); - imwrite(svpath, process_image); +// char svpath[1024]; +// memset(svpath, 0, sizeof(svpath)); +// std::string strNewTime2 = AppUtil::getTimeUSecString(); +// strNewTime2.append(".jpg"); +// +// sprintf(svpath, "vpt_res/%s", strNewTime2.c_str()); +// imwrite(svpath, process_image); #endif - //release source - if (result.info != NULL) { - for (int i = 0; i < MAX_DET_COUNT; i++) { - if (result.info[i].analysis_res != NULL) { - delete result.info[i].analysis_res; - result.info[i].analysis_res = NULL; - } - } - delete[] result.info; - result.info = NULL; - } capture >> process_image;//璇诲嚭姣忎竴甯х殑鍥惧儚 } - vpt_pic_release(&handle); - return 0; } - -void printfAnalysisRes(int index, void *result) { - if (index == 0 && result != NULL) //琛屼汉浜屾灞炴�у垎鏋愮粨鏋� - { - hp_res *cur_res = (hp_res *) result; - - for (int i = 0; i < HP_FIR_INDEX_SIZE; i++) { - int resIndex = cur_res->res_objs[i].res_index; - cur_res->res_objs[i].res_prob; - cout << HpResStr[i][resIndex] << " " << endl; - - } - cout << endl << endl; - } else if ((index == 1 || index == 2) && result != NULL) //琛屼汉浜屾灞炴�у垎鏋愮粨鏋� - { - hcp_res *cur_res = (hcp_res *) result; - - for (int i = 0; i < HCP_FIR_INDEX_SIZE; i++) { - int resIndex = cur_res->res_objs[i].res_index; - cur_res->res_objs[i].res_prob; -// cout << HcpResStr[i][resIndex] << " " << endl; - } - cout << endl << endl; - } else if (index > 3 && index != 7 && result != NULL) //杞﹁締浜屾灞炴�у垎鏋愮粨鏋滆緭鍑� - { - vehicle_res *cur_res = (vehicle_res *) result; - - cout << "杞﹂鑹�: " << colorLabel[cur_res->vc_res.res_index] << " " << cur_res->vc_res.res_prob << endl; - - cout << "杞﹀瀷璇嗗埆: " << endl; - if (cur_res->vr_res.vehicle_brand != NULL) { - cout << " 杞﹁締鍝佺墝 - " << cur_res->vr_res.vehicle_brand << endl; - delete[] cur_res->vr_res.vehicle_brand; - cur_res->vr_res.vehicle_brand = NULL; - } - if (cur_res->vr_res.vehicle_subbrand != NULL) { - cout << " 杞﹁締瀛愬搧鐗� - " << cur_res->vr_res.vehicle_subbrand << endl; - delete[] cur_res->vr_res.vehicle_subbrand; - cur_res->vr_res.vehicle_subbrand = NULL; - } - if (cur_res->vr_res.vehicle_issue_year != NULL) { - cout << " 杞﹁締骞存 - " << cur_res->vr_res.vehicle_issue_year << endl; - delete[] cur_res->vr_res.vehicle_issue_year; - cur_res->vr_res.vehicle_issue_year = NULL; - } - if (cur_res->vr_res.vehicle_type != NULL) { - cout << " 杞﹁締绫诲瀷 - " << cur_res->vr_res.vehicle_type << endl; - delete[] cur_res->vr_res.vehicle_type; - cur_res->vr_res.vehicle_type = NULL; - } - - if (cur_res->vr_res.freight_ton != NULL) { - cout << " 璐ц溅鍚ㄧ骇 - " << cur_res->vr_res.freight_ton << endl; - delete[] cur_res->vr_res.freight_ton; - cur_res->vr_res.freight_ton = NULL; - } - cout << " " << cur_res->vr_res.name_score << endl; - - - if (cur_res->vp_res.rect.height_ != 0 && cur_res->vp_res.rect.width_ != 0) { - cout << "杞︾墝浣嶇疆: " << cur_res->vp_res.rect.left_ << " " << cur_res->vp_res.rect.top_ << " " - << cur_res->vp_res.rect.width_ << " " << cur_res->vp_res.rect.height_ << endl; - - for (int m = 0; m < 7; m++) { - printf("%s", cur_res->vp_res.recg[m].character); - } - printf(" numScore = %.2f, detectScore = %.2f\n", cur_res->vp_res.numScore, cur_res->vp_res.detectScore); - } - - cout << endl; - } -} diff --git a/QiaoJiaSystem/VptServer/mainAssist.h b/QiaoJiaSystem/VptServer/mainAssist.h index 7f0835f..bf7249d 100644 --- a/QiaoJiaSystem/VptServer/mainAssist.h +++ b/QiaoJiaSystem/VptServer/mainAssist.h @@ -90,8 +90,10 @@ //杞﹁締浜屾灞炴�у垎鏋愮粨鏋� static char colorLabel[14][8] = {"妫�", "姗�", "鐏�", "鐧�", "绮�", "绱�", "绾�", "缁�", "钃�", "閲�", "閾�", "闈�", "榛�", "榛�"}; +static std::string colorLabelStr[14] = {"妫�", "姗�", "鐏�", "鐧�", "绮�", "绱�", "绾�", "缁�", "钃�", "閲�", "閾�", "闈�", "榛�", "榛�"}; enum class ColorLabel { + test = -1, Brown = 0, Orange, Gray, diff --git a/QiaoJiaSystem/VptServer/rpc/VptServer.cpp b/QiaoJiaSystem/VptServer/rpc/VptServer.cpp new file mode 100644 index 0000000..0c7b642 --- /dev/null +++ b/QiaoJiaSystem/VptServer/rpc/VptServer.cpp @@ -0,0 +1,851 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** +// +// Ice version 3.7.0 +// +// <auto-generated> +// +// Generated from file `VptServer.ice' +// +// Warning: do not edit this file. +// +// </auto-generated> +// + +#include <VptServer.h> +#include <IceUtil/PushDisableWarnings.h> +#include <Ice/LocalException.h> +#include <Ice/ValueFactory.h> +#include <Ice/OutgoingAsync.h> +#include <Ice/InputStream.h> +#include <Ice/OutputStream.h> +#include <IceUtil/PopDisableWarnings.h> + +#if defined(_MSC_VER) +# pragma warning(disable:4458) // declaration of ... hides class member +#elif defined(__clang__) +# pragma clang diagnostic ignored "-Wshadow" +#elif defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wshadow" +#endif + +#ifndef ICE_IGNORE_VERSION +# if ICE_INT_VERSION / 100 != 307 +# error Ice version mismatch! +# endif +# if ICE_INT_VERSION % 100 > 50 +# error Beta header file detected +# endif +# if ICE_INT_VERSION % 100 < 0 +# error Ice patch level mismatch! +# endif +#endif + +#ifdef ICE_CPP11_MAPPING // C++11 mapping + +namespace +{ + +const ::std::string iceC_VptDetect_VptDetectServer_ids[2] = +{ + "::Ice::Object", + "::VptDetect::VptDetectServer" +}; +const ::std::string iceC_VptDetect_VptDetectServer_ops[] = +{ + "VptDetect", + "getColorLabel", + "getHcpResStr", + "getHpResStr", + "getStr", + "getTypeStr", + "ice_id", + "ice_ids", + "ice_isA", + "ice_ping" +}; +const ::std::string iceC_VptDetect_VptDetectServer_VptDetect_name = "VptDetect"; +const ::std::string iceC_VptDetect_VptDetectServer_getStr_name = "getStr"; +const ::std::string iceC_VptDetect_VptDetectServer_getTypeStr_name = "getTypeStr"; +const ::std::string iceC_VptDetect_VptDetectServer_getColorLabel_name = "getColorLabel"; +const ::std::string iceC_VptDetect_VptDetectServer_getHpResStr_name = "getHpResStr"; +const ::std::string iceC_VptDetect_VptDetectServer_getHcpResStr_name = "getHcpResStr"; + +} + +bool +VptDetect::VptDetectServer::ice_isA(::std::string s, const ::Ice::Current&) const +{ + return ::std::binary_search(iceC_VptDetect_VptDetectServer_ids, iceC_VptDetect_VptDetectServer_ids + 2, s); +} + +::std::vector<::std::string> +VptDetect::VptDetectServer::ice_ids(const ::Ice::Current&) const +{ + return ::std::vector<::std::string>(&iceC_VptDetect_VptDetectServer_ids[0], &iceC_VptDetect_VptDetectServer_ids[2]); +} + +::std::string +VptDetect::VptDetectServer::ice_id(const ::Ice::Current&) const +{ + return ice_staticId(); +} + +const ::std::string& +VptDetect::VptDetectServer::ice_staticId() +{ + static const ::std::string typeId = "::VptDetect::VptDetectServer"; + return typeId; +} + +bool +VptDetect::VptDetectServer::_iceD_VptDetect(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + auto istr = inS.startReadParams(); + int iceP_width; + int iceP_height; + ::std::string iceP_shareMemory; + istr->readAll(iceP_width, iceP_height, iceP_shareMemory); + inS.endReadParams(); + ::VptDetect::ObjInfos ret = this->VptDetect(iceP_width, iceP_height, ::std::move(iceP_shareMemory), current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + auto istr = inS.startReadParams(); + int iceP_type; + istr->readAll(iceP_type); + inS.endReadParams(); + ::VptDetect::stringDatas ret = this->getStr(iceP_type, current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getTypeStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringData ret = this->getTypeStr(current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getColorLabel(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringData ret = this->getColorLabel(current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getHpResStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringDatas ret = this->getHpResStr(current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getHcpResStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::OperationMode::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringDatas ret = this->getHcpResStr(current); + auto ostr = inS.startWriteParams(); + ostr->writeAll(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current) +{ + ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_VptDetect_VptDetectServer_ops, iceC_VptDetect_VptDetectServer_ops + 10, current.operation); + if(r.first == r.second) + { + throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); + } + + switch(r.first - iceC_VptDetect_VptDetectServer_ops) + { + case 0: + { + return _iceD_VptDetect(in, current); + } + case 1: + { + return _iceD_getColorLabel(in, current); + } + case 2: + { + return _iceD_getHcpResStr(in, current); + } + case 3: + { + return _iceD_getHpResStr(in, current); + } + case 4: + { + return _iceD_getStr(in, current); + } + case 5: + { + return _iceD_getTypeStr(in, current); + } + case 6: + { + return _iceD_ice_id(in, current); + } + case 7: + { + return _iceD_ice_ids(in, current); + } + case 8: + { + return _iceD_ice_isA(in, current); + } + case 9: + { + return _iceD_ice_ping(in, current); + } + default: + { + assert(false); + throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); + } + } +} + +void +VptDetect::VptDetectServerPrx::_iceI_VptDetect(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::ObjInfos>>& outAsync, int iceP_width, int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_VptDetect_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_VptDetect_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + [&](::Ice::OutputStream* ostr) + { + ostr->writeAll(iceP_width, iceP_height, iceP_shareMemory); + }, + nullptr); +} + +void +VptDetect::VptDetectServerPrx::_iceI_getStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>& outAsync, int iceP_type, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getStr_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_getStr_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + [&](::Ice::OutputStream* ostr) + { + ostr->writeAll(iceP_type); + }, + nullptr); +} + +void +VptDetect::VptDetectServerPrx::_iceI_getTypeStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringData>>& outAsync, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getTypeStr_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_getTypeStr_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + nullptr, + nullptr); +} + +void +VptDetect::VptDetectServerPrx::_iceI_getColorLabel(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringData>>& outAsync, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getColorLabel_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_getColorLabel_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + nullptr, + nullptr); +} + +void +VptDetect::VptDetectServerPrx::_iceI_getHpResStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>& outAsync, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getHpResStr_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_getHpResStr_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + nullptr, + nullptr); +} + +void +VptDetect::VptDetectServerPrx::_iceI_getHcpResStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>& outAsync, const ::Ice::Context& context) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getHcpResStr_name); + outAsync->invoke(iceC_VptDetect_VptDetectServer_getHcpResStr_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context, + nullptr, + nullptr); +} + +::std::shared_ptr<::Ice::ObjectPrx> +VptDetect::VptDetectServerPrx::_newInstance() const +{ + return ::IceInternal::createProxy<VptDetectServerPrx>(); +} + +const ::std::string& +VptDetect::VptDetectServerPrx::ice_staticId() +{ + return VptDetect::VptDetectServer::ice_staticId(); +} + +namespace Ice +{ +} + +#else // C++98 mapping + +namespace +{ + +const ::std::string iceC_VptDetect_VptDetectServer_VptDetect_name = "VptDetect"; + +const ::std::string iceC_VptDetect_VptDetectServer_getStr_name = "getStr"; + +const ::std::string iceC_VptDetect_VptDetectServer_getTypeStr_name = "getTypeStr"; + +const ::std::string iceC_VptDetect_VptDetectServer_getColorLabel_name = "getColorLabel"; + +const ::std::string iceC_VptDetect_VptDetectServer_getHpResStr_name = "getHpResStr"; + +const ::std::string iceC_VptDetect_VptDetectServer_getHcpResStr_name = "getHcpResStr"; + +} +::IceProxy::Ice::Object* ::IceProxy::VptDetect::upCast(::IceProxy::VptDetect::VptDetectServer* p) { return p; } + +void +::IceProxy::VptDetect::_readProxy(::Ice::InputStream* istr, ::IceInternal::ProxyHandle< ::IceProxy::VptDetect::VptDetectServer>& v) +{ + ::Ice::ObjectPrx proxy; + istr->read(proxy); + if(!proxy) + { + v = 0; + } + else + { + v = new ::IceProxy::VptDetect::VptDetectServer; + v->_copyFrom(proxy); + } +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_VptDetect_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_VptDetect_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_VptDetect_name, ::Ice::Normal, context); + ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat); + ostr->write(iceP_width); + ostr->write(iceP_height); + ostr->write(iceP_shareMemory); + result->endWriteParams(); + result->invoke(iceC_VptDetect_VptDetectServer_VptDetect_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::ObjInfos +IceProxy::VptDetect::VptDetectServer::end_VptDetect(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_VptDetect_name); + ::VptDetect::ObjInfos ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_getStr(::Ice::Int iceP_type, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getStr_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_getStr_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_getStr_name, ::Ice::Normal, context); + ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat); + ostr->write(iceP_type); + result->endWriteParams(); + result->invoke(iceC_VptDetect_VptDetectServer_getStr_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::stringDatas +IceProxy::VptDetect::VptDetectServer::end_getStr(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_getStr_name); + ::VptDetect::stringDatas ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_getTypeStr(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getTypeStr_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_getTypeStr_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_getTypeStr_name, ::Ice::Normal, context); + result->writeEmptyParams(); + result->invoke(iceC_VptDetect_VptDetectServer_getTypeStr_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::stringData +IceProxy::VptDetect::VptDetectServer::end_getTypeStr(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_getTypeStr_name); + ::VptDetect::stringData ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_getColorLabel(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getColorLabel_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_getColorLabel_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_getColorLabel_name, ::Ice::Normal, context); + result->writeEmptyParams(); + result->invoke(iceC_VptDetect_VptDetectServer_getColorLabel_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::stringData +IceProxy::VptDetect::VptDetectServer::end_getColorLabel(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_getColorLabel_name); + ::VptDetect::stringData ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_getHpResStr(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getHpResStr_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_getHpResStr_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_getHpResStr_name, ::Ice::Normal, context); + result->writeEmptyParams(); + result->invoke(iceC_VptDetect_VptDetectServer_getHpResStr_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::stringDatas +IceProxy::VptDetect::VptDetectServer::end_getHpResStr(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_getHpResStr_name); + ::VptDetect::stringDatas ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::Ice::AsyncResultPtr +IceProxy::VptDetect::VptDetectServer::_iceI_begin_getHcpResStr(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync) +{ + _checkTwowayOnly(iceC_VptDetect_VptDetectServer_getHcpResStr_name, sync); + ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_VptDetect_VptDetectServer_getHcpResStr_name, del, cookie, sync); + try + { + result->prepare(iceC_VptDetect_VptDetectServer_getHcpResStr_name, ::Ice::Normal, context); + result->writeEmptyParams(); + result->invoke(iceC_VptDetect_VptDetectServer_getHcpResStr_name); + } + catch(const ::Ice::Exception& ex) + { + result->abort(ex); + } + return result; +} + +::VptDetect::stringDatas +IceProxy::VptDetect::VptDetectServer::end_getHcpResStr(const ::Ice::AsyncResultPtr& result) +{ + ::Ice::AsyncResult::_check(result, this, iceC_VptDetect_VptDetectServer_getHcpResStr_name); + ::VptDetect::stringDatas ret; + if(!result->_waitForResponse()) + { + try + { + result->_throwUserException(); + } + catch(const ::Ice::UserException& ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } + } + ::Ice::InputStream* istr = result->_startReadParams(); + istr->read(ret); + result->_endReadParams(); + return ret; +} + +::IceProxy::Ice::Object* +IceProxy::VptDetect::VptDetectServer::_newInstance() const +{ + return new VptDetectServer; +} + +const ::std::string& +IceProxy::VptDetect::VptDetectServer::ice_staticId() +{ + return ::VptDetect::VptDetectServer::ice_staticId(); +} + +VptDetect::VptDetectServer::~VptDetectServer() +{ +} + +::Ice::Object* VptDetect::upCast(::VptDetect::VptDetectServer* p) { return p; } + + +namespace +{ +const ::std::string iceC_VptDetect_VptDetectServer_ids[2] = +{ + "::Ice::Object", + "::VptDetect::VptDetectServer" +}; + +} + +bool +VptDetect::VptDetectServer::ice_isA(const ::std::string& s, const ::Ice::Current&) const +{ + return ::std::binary_search(iceC_VptDetect_VptDetectServer_ids, iceC_VptDetect_VptDetectServer_ids + 2, s); +} + +::std::vector< ::std::string> +VptDetect::VptDetectServer::ice_ids(const ::Ice::Current&) const +{ + return ::std::vector< ::std::string>(&iceC_VptDetect_VptDetectServer_ids[0], &iceC_VptDetect_VptDetectServer_ids[2]); +} + +const ::std::string& +VptDetect::VptDetectServer::ice_id(const ::Ice::Current&) const +{ + return ice_staticId(); +} + +const ::std::string& +VptDetect::VptDetectServer::ice_staticId() +{ +#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC + static const ::std::string typeId = "::VptDetect::VptDetectServer"; + return typeId; +#else + return iceC_VptDetect_VptDetectServer_ids[1]; +#endif +} + +bool +VptDetect::VptDetectServer::_iceD_VptDetect(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + ::Ice::InputStream* istr = inS.startReadParams(); + ::Ice::Int iceP_width; + ::Ice::Int iceP_height; + ::std::string iceP_shareMemory; + istr->read(iceP_width); + istr->read(iceP_height); + istr->read(iceP_shareMemory); + inS.endReadParams(); + ::VptDetect::ObjInfos ret = this->VptDetect(iceP_width, iceP_height, iceP_shareMemory, current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + ::Ice::InputStream* istr = inS.startReadParams(); + ::Ice::Int iceP_type; + istr->read(iceP_type); + inS.endReadParams(); + ::VptDetect::stringDatas ret = this->getStr(iceP_type, current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getTypeStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringData ret = this->getTypeStr(current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getColorLabel(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringData ret = this->getColorLabel(current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getHpResStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringDatas ret = this->getHpResStr(current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +bool +VptDetect::VptDetectServer::_iceD_getHcpResStr(::IceInternal::Incoming& inS, const ::Ice::Current& current) +{ + _iceCheckMode(::Ice::Normal, current.mode); + inS.readEmptyParams(); + ::VptDetect::stringDatas ret = this->getHcpResStr(current); + ::Ice::OutputStream* ostr = inS.startWriteParams(); + ostr->write(ret); + inS.endWriteParams(); + return true; +} + +namespace +{ +const ::std::string iceC_VptDetect_VptDetectServer_all[] = +{ + "VptDetect", + "getColorLabel", + "getHcpResStr", + "getHpResStr", + "getStr", + "getTypeStr", + "ice_id", + "ice_ids", + "ice_isA", + "ice_ping" +}; + +} + +bool +VptDetect::VptDetectServer::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current) +{ + ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_VptDetect_VptDetectServer_all, iceC_VptDetect_VptDetectServer_all + 10, current.operation); + if(r.first == r.second) + { + throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); + } + + switch(r.first - iceC_VptDetect_VptDetectServer_all) + { + case 0: + { + return _iceD_VptDetect(in, current); + } + case 1: + { + return _iceD_getColorLabel(in, current); + } + case 2: + { + return _iceD_getHcpResStr(in, current); + } + case 3: + { + return _iceD_getHpResStr(in, current); + } + case 4: + { + return _iceD_getStr(in, current); + } + case 5: + { + return _iceD_getTypeStr(in, current); + } + case 6: + { + return _iceD_ice_id(in, current); + } + case 7: + { + return _iceD_ice_ids(in, current); + } + case 8: + { + return _iceD_ice_isA(in, current); + } + case 9: + { + return _iceD_ice_ping(in, current); + } + default: + { + assert(false); + throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); + } + } +} + +void +VptDetect::VptDetectServer::_iceWriteImpl(::Ice::OutputStream* ostr) const +{ + ostr->startSlice(ice_staticId(), -1, true); + Ice::StreamWriter< ::VptDetect::VptDetectServer, ::Ice::OutputStream>::write(ostr, *this); + ostr->endSlice(); +} + +void +VptDetect::VptDetectServer::_iceReadImpl(::Ice::InputStream* istr) +{ + istr->startSlice(); + Ice::StreamReader< ::VptDetect::VptDetectServer, ::Ice::InputStream>::read(istr, *this); + istr->endSlice(); +} + +void +VptDetect::_icePatchObjectPtr(VptDetectServerPtr& handle, const ::Ice::ObjectPtr& v) +{ + handle = ::VptDetect::VptDetectServerPtr::dynamicCast(v); + if(v && !handle) + { + IceInternal::Ex::throwUOE(::VptDetect::VptDetectServer::ice_staticId(), v); + } +} + +namespace Ice +{ +} + +#endif diff --git a/QiaoJiaSystem/VptServer/rpc/VptServer.h b/QiaoJiaSystem/VptServer/rpc/VptServer.h new file mode 100644 index 0000000..e41584d --- /dev/null +++ b/QiaoJiaSystem/VptServer/rpc/VptServer.h @@ -0,0 +1,1728 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** +// +// Ice version 3.7.0 +// +// <auto-generated> +// +// Generated from file `VptServer.ice' +// +// Warning: do not edit this file. +// +// </auto-generated> +// + +#ifndef __VptServer_h__ +#define __VptServer_h__ + +#include <IceUtil/PushDisableWarnings.h> +#include <Ice/ProxyF.h> +#include <Ice/ObjectF.h> +#include <Ice/ValueF.h> +#include <Ice/Exception.h> +#include <Ice/LocalObject.h> +#include <Ice/StreamHelpers.h> +#include <Ice/Comparable.h> +#include <Ice/Proxy.h> +#include <Ice/Object.h> +#include <Ice/GCObject.h> +#include <Ice/Value.h> +#include <Ice/Incoming.h> +#include <Ice/FactoryTableInit.h> +#include <IceUtil/ScopedArray.h> +#include <Ice/Optional.h> +#include <IceUtil/UndefSysMacros.h> + +#ifndef ICE_IGNORE_VERSION +# if ICE_INT_VERSION / 100 != 307 +# error Ice version mismatch! +# endif +# if ICE_INT_VERSION % 100 > 50 +# error Beta header file detected +# endif +# if ICE_INT_VERSION % 100 < 0 +# error Ice patch level mismatch! +# endif +#endif + +#ifdef ICE_CPP11_MAPPING // C++11 mapping + +namespace VptDetect +{ + +class VptDetectServer; +class VptDetectServerPrx; + +} + +namespace VptDetect +{ + +struct RECT +{ + float left; + float top; + float width; + float height; + + std::tuple<const float&, const float&, const float&, const float&> ice_tuple() const + { + return std::tie(left, top, width, height); + } +}; + +struct ClassfyObjRes +{ + int res_index; + float res_prob; + + std::tuple<const int&, const float&> ice_tuple() const + { + return std::tie(res_index, res_prob); + } +}; + +using ResObjs = ::std::vector<::VptDetect::ClassfyObjRes>; + +struct PersonDetectRes +{ + ::VptDetect::ResObjs res_objs; + + std::tuple<const ::VptDetect::ResObjs&> ice_tuple() const + { + return std::tie(res_objs); + } +}; + +struct PerRideCarDetectRes +{ + ::VptDetect::ResObjs res_objs; + + std::tuple<const ::VptDetect::ResObjs&> ice_tuple() const + { + return std::tie(res_objs); + } +}; + +struct CarDetectRes +{ + ::std::string vehicle_brand; + ::std::string vehicle_subbrand; + ::std::string vehicle_issue_year; + ::std::string vehicle_type; + ::std::string freight_ton; + float vehicle_score; + int colorLabel; + float colorLabelProb; + ::VptDetect::RECT carPlateRect; + float carPlateRectScore; + ::std::string carPlate; + float carPlateScore; + int carPlatetype; + + std::tuple<const ::std::string&, const ::std::string&, const ::std::string&, const ::std::string&, const ::std::string&, const float&, const int&, const float&, const ::VptDetect::RECT&, const float&, const ::std::string&, const float&, const int&> ice_tuple() const + { + return std::tie(vehicle_brand, vehicle_subbrand, vehicle_issue_year, vehicle_type, freight_ton, vehicle_score, colorLabel, colorLabelProb, carPlateRect, carPlateRectScore, carPlate, carPlateScore, carPlatetype); + } +}; + +struct VptDetectResult +{ + int sdkDetectType; + ::VptDetect::RECT bskRect; + ::VptDetect::PersonDetectRes personDetectRes; + ::VptDetect::PerRideCarDetectRes perRideCarDetectRes; + ::VptDetect::CarDetectRes carDetectRes; + + std::tuple<const int&, const ::VptDetect::RECT&, const ::VptDetect::PersonDetectRes&, const ::VptDetect::PerRideCarDetectRes&, const ::VptDetect::CarDetectRes&> ice_tuple() const + { + return std::tie(sdkDetectType, bskRect, personDetectRes, perRideCarDetectRes, carDetectRes); + } +}; + +using ObjInfos = ::std::vector<::VptDetect::VptDetectResult>; + +using stringData = ::std::vector<::std::string>; + +using stringDatas = ::std::vector<::VptDetect::stringData>; + +using Ice::operator<; +using Ice::operator<=; +using Ice::operator>; +using Ice::operator>=; +using Ice::operator==; +using Ice::operator!=; + +} + +namespace VptDetect +{ + +class VptDetectServer : public virtual ::Ice::Object +{ +public: + + using ProxyType = VptDetectServerPrx; + + virtual bool ice_isA(::std::string, const ::Ice::Current&) const override; + virtual ::std::vector<::std::string> ice_ids(const ::Ice::Current&) const override; + virtual ::std::string ice_id(const ::Ice::Current&) const override; + + static const ::std::string& ice_staticId(); + + virtual ::VptDetect::ObjInfos VptDetect(int, int, ::std::string, const ::Ice::Current&) = 0; + bool _iceD_VptDetect(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getStr(int, const ::Ice::Current&) = 0; + bool _iceD_getStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringData getTypeStr(const ::Ice::Current&) = 0; + bool _iceD_getTypeStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringData getColorLabel(const ::Ice::Current&) = 0; + bool _iceD_getColorLabel(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getHpResStr(const ::Ice::Current&) = 0; + bool _iceD_getHpResStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getHcpResStr(const ::Ice::Current&) = 0; + bool _iceD_getHcpResStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&) override; +}; + +} + +namespace VptDetect +{ + +class VptDetectServerPrx : public virtual ::Ice::Proxy<VptDetectServerPrx, ::Ice::ObjectPrx> +{ +public: + + ::VptDetect::ObjInfos VptDetect(int iceP_width, int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::ObjInfos>(true, this, &VptDetect::VptDetectServerPrx::_iceI_VptDetect, iceP_width, iceP_height, iceP_shareMemory, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto VptDetectAsync(int iceP_width, int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::ObjInfos>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::ObjInfos, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_VptDetect, iceP_width, iceP_height, iceP_shareMemory, context); + } + + ::std::function<void()> + VptDetectAsync(int iceP_width, int iceP_height, const ::std::string& iceP_shareMemory, + ::std::function<void(::VptDetect::ObjInfos)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::ObjInfos>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_VptDetect, iceP_width, iceP_height, iceP_shareMemory, context); + } + + void _iceI_VptDetect(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::ObjInfos>>&, int, int, const ::std::string&, const ::Ice::Context&); + + ::VptDetect::stringDatas getStr(int iceP_type, const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::stringDatas>(true, this, &VptDetect::VptDetectServerPrx::_iceI_getStr, iceP_type, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto getStrAsync(int iceP_type, const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::stringDatas>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::stringDatas, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_getStr, iceP_type, context); + } + + ::std::function<void()> + getStrAsync(int iceP_type, + ::std::function<void(::VptDetect::stringDatas)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::stringDatas>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_getStr, iceP_type, context); + } + + void _iceI_getStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>&, int, const ::Ice::Context&); + + ::VptDetect::stringData getTypeStr(const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::stringData>(true, this, &VptDetect::VptDetectServerPrx::_iceI_getTypeStr, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto getTypeStrAsync(const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::stringData>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::stringData, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_getTypeStr, context); + } + + ::std::function<void()> + getTypeStrAsync(::std::function<void(::VptDetect::stringData)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::stringData>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_getTypeStr, context); + } + + void _iceI_getTypeStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringData>>&, const ::Ice::Context&); + + ::VptDetect::stringData getColorLabel(const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::stringData>(true, this, &VptDetect::VptDetectServerPrx::_iceI_getColorLabel, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto getColorLabelAsync(const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::stringData>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::stringData, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_getColorLabel, context); + } + + ::std::function<void()> + getColorLabelAsync(::std::function<void(::VptDetect::stringData)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::stringData>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_getColorLabel, context); + } + + void _iceI_getColorLabel(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringData>>&, const ::Ice::Context&); + + ::VptDetect::stringDatas getHpResStr(const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::stringDatas>(true, this, &VptDetect::VptDetectServerPrx::_iceI_getHpResStr, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto getHpResStrAsync(const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::stringDatas>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::stringDatas, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_getHpResStr, context); + } + + ::std::function<void()> + getHpResStrAsync(::std::function<void(::VptDetect::stringDatas)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::stringDatas>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_getHpResStr, context); + } + + void _iceI_getHpResStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>&, const ::Ice::Context&); + + ::VptDetect::stringDatas getHcpResStr(const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makePromiseOutgoing<::VptDetect::stringDatas>(true, this, &VptDetect::VptDetectServerPrx::_iceI_getHcpResStr, context).get(); + } + + template<template<typename> class P = ::std::promise> + auto getHcpResStrAsync(const ::Ice::Context& context = Ice::noExplicitContext) + -> decltype(::std::declval<P<::VptDetect::stringDatas>>().get_future()) + { + return _makePromiseOutgoing<::VptDetect::stringDatas, P>(false, this, &VptDetect::VptDetectServerPrx::_iceI_getHcpResStr, context); + } + + ::std::function<void()> + getHcpResStrAsync(::std::function<void(::VptDetect::stringDatas)> response, + ::std::function<void(::std::exception_ptr)> ex = nullptr, + ::std::function<void(bool)> sent = nullptr, + const ::Ice::Context& context = Ice::noExplicitContext) + { + return _makeLamdaOutgoing<::VptDetect::stringDatas>(response, ex, sent, this, &VptDetect::VptDetectServerPrx::_iceI_getHcpResStr, context); + } + + void _iceI_getHcpResStr(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::VptDetect::stringDatas>>&, const ::Ice::Context&); + + static const ::std::string& ice_staticId(); + +protected: + + VptDetectServerPrx() = default; + friend ::std::shared_ptr<VptDetectServerPrx> IceInternal::createProxy<VptDetectServerPrx>(); + + virtual ::std::shared_ptr<::Ice::ObjectPrx> _newInstance() const override; +}; + +} + +namespace Ice +{ + +template<> +struct StreamableTraits<::VptDetect::RECT> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 16; + static const bool fixedLength = true; +}; + +template<typename S> +struct StreamReader<::VptDetect::RECT, S> +{ + static void read(S* istr, ::VptDetect::RECT& v) + { + istr->readAll(v.left, v.top, v.width, v.height); + } +}; + +template<> +struct StreamableTraits<::VptDetect::ClassfyObjRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 8; + static const bool fixedLength = true; +}; + +template<typename S> +struct StreamReader<::VptDetect::ClassfyObjRes, S> +{ + static void read(S* istr, ::VptDetect::ClassfyObjRes& v) + { + istr->readAll(v.res_index, v.res_prob); + } +}; + +template<> +struct StreamableTraits<::VptDetect::PersonDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 1; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamReader<::VptDetect::PersonDetectRes, S> +{ + static void read(S* istr, ::VptDetect::PersonDetectRes& v) + { + istr->readAll(v.res_objs); + } +}; + +template<> +struct StreamableTraits<::VptDetect::PerRideCarDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 1; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamReader<::VptDetect::PerRideCarDetectRes, S> +{ + static void read(S* istr, ::VptDetect::PerRideCarDetectRes& v) + { + istr->readAll(v.res_objs); + } +}; + +template<> +struct StreamableTraits<::VptDetect::CarDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 46; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamReader<::VptDetect::CarDetectRes, S> +{ + static void read(S* istr, ::VptDetect::CarDetectRes& v) + { + istr->readAll(v.vehicle_brand, v.vehicle_subbrand, v.vehicle_issue_year, v.vehicle_type, v.freight_ton, v.vehicle_score, v.colorLabel, v.colorLabelProb, v.carPlateRect, v.carPlateRectScore, v.carPlate, v.carPlateScore, v.carPlatetype); + } +}; + +template<> +struct StreamableTraits<::VptDetect::VptDetectResult> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 68; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamReader<::VptDetect::VptDetectResult, S> +{ + static void read(S* istr, ::VptDetect::VptDetectResult& v) + { + istr->readAll(v.sdkDetectType, v.bskRect, v.personDetectRes, v.perRideCarDetectRes, v.carDetectRes); + } +}; + +} + +namespace VptDetect +{ + +using VptDetectServerPtr = ::std::shared_ptr<VptDetectServer>; +using VptDetectServerPrxPtr = ::std::shared_ptr<VptDetectServerPrx>; + +} + +#else // C++98 mapping + +namespace IceProxy +{ + +namespace VptDetect +{ + +class VptDetectServer; +void _readProxy(::Ice::InputStream*, ::IceInternal::ProxyHandle< ::IceProxy::VptDetect::VptDetectServer>&); +::IceProxy::Ice::Object* upCast(::IceProxy::VptDetect::VptDetectServer*); + +} + +} + +namespace VptDetect +{ + +class VptDetectServer; +::Ice::Object* upCast(::VptDetect::VptDetectServer*); +typedef ::IceInternal::Handle< ::VptDetect::VptDetectServer> VptDetectServerPtr; +typedef ::IceInternal::ProxyHandle< ::IceProxy::VptDetect::VptDetectServer> VptDetectServerPrx; +typedef VptDetectServerPrx VptDetectServerPrxPtr; +void _icePatchObjectPtr(VptDetectServerPtr&, const ::Ice::ObjectPtr&); + +} + +namespace VptDetect +{ + +struct RECT +{ + ::Ice::Float left; + ::Ice::Float top; + ::Ice::Float width; + ::Ice::Float height; +}; + +struct ClassfyObjRes +{ + ::Ice::Int res_index; + ::Ice::Float res_prob; +}; + +typedef ::std::vector< ::VptDetect::ClassfyObjRes> ResObjs; + +struct PersonDetectRes +{ + ::VptDetect::ResObjs res_objs; +}; + +struct PerRideCarDetectRes +{ + ::VptDetect::ResObjs res_objs; +}; + +struct CarDetectRes +{ + ::std::string vehicle_brand; + ::std::string vehicle_subbrand; + ::std::string vehicle_issue_year; + ::std::string vehicle_type; + ::std::string freight_ton; + ::Ice::Float vehicle_score; + ::Ice::Int colorLabel; + ::Ice::Float colorLabelProb; + ::VptDetect::RECT carPlateRect; + ::Ice::Float carPlateRectScore; + ::std::string carPlate; + ::Ice::Float carPlateScore; + ::Ice::Int carPlatetype; +}; + +struct VptDetectResult +{ + ::Ice::Int sdkDetectType; + ::VptDetect::RECT bskRect; + ::VptDetect::PersonDetectRes personDetectRes; + ::VptDetect::PerRideCarDetectRes perRideCarDetectRes; + ::VptDetect::CarDetectRes carDetectRes; +}; + +typedef ::std::vector< ::VptDetect::VptDetectResult> ObjInfos; + +typedef ::std::vector< ::std::string> stringData; + +typedef ::std::vector< ::VptDetect::stringData> stringDatas; + +} + +namespace VptDetect +{ + +class Callback_VptDetectServer_VptDetect_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_VptDetect_Base> Callback_VptDetectServer_VptDetectPtr; + +class Callback_VptDetectServer_getStr_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_getStr_Base> Callback_VptDetectServer_getStrPtr; + +class Callback_VptDetectServer_getTypeStr_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_getTypeStr_Base> Callback_VptDetectServer_getTypeStrPtr; + +class Callback_VptDetectServer_getColorLabel_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_getColorLabel_Base> Callback_VptDetectServer_getColorLabelPtr; + +class Callback_VptDetectServer_getHpResStr_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_getHpResStr_Base> Callback_VptDetectServer_getHpResStrPtr; + +class Callback_VptDetectServer_getHcpResStr_Base : public virtual ::IceInternal::CallbackBase { }; +typedef ::IceUtil::Handle< Callback_VptDetectServer_getHcpResStr_Base> Callback_VptDetectServer_getHcpResStrPtr; + +} + +namespace IceProxy +{ + +namespace VptDetect +{ + +class VptDetectServer : public virtual ::Ice::Proxy<VptDetectServer, ::IceProxy::Ice::Object> +{ +public: + + ::VptDetect::ObjInfos VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_VptDetect(_iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, ::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::VptDetect::Callback_VptDetectServer_VptDetectPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, ::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_VptDetect(::Ice::Int iceP_width, ::Ice::Int iceP_height, const ::std::string& iceP_shareMemory, const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_VptDetectPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_VptDetect(iceP_width, iceP_height, iceP_shareMemory, context, del, cookie); + } + + ::VptDetect::ObjInfos end_VptDetect(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_VptDetect(::Ice::Int, ::Ice::Int, const ::std::string&, const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + ::VptDetect::stringDatas getStr(::Ice::Int iceP_type, const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_getStr(_iceI_begin_getStr(iceP_type, context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_getStr(::Ice::Int iceP_type, const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_getStr(iceP_type, context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_getStr(::Ice::Int iceP_type, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getStr(iceP_type, ::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getStr(::Ice::Int iceP_type, const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getStr(iceP_type, context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getStr(::Ice::Int iceP_type, const ::VptDetect::Callback_VptDetectServer_getStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getStr(iceP_type, ::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getStr(::Ice::Int iceP_type, const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_getStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getStr(iceP_type, context, del, cookie); + } + + ::VptDetect::stringDatas end_getStr(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_getStr(::Ice::Int, const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + ::VptDetect::stringData getTypeStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_getTypeStr(_iceI_begin_getTypeStr(context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_getTypeStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_getTypeStr(context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_getTypeStr(const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getTypeStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getTypeStr(const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getTypeStr(context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getTypeStr(const ::VptDetect::Callback_VptDetectServer_getTypeStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getTypeStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getTypeStr(const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_getTypeStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getTypeStr(context, del, cookie); + } + + ::VptDetect::stringData end_getTypeStr(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_getTypeStr(const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + ::VptDetect::stringData getColorLabel(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_getColorLabel(_iceI_begin_getColorLabel(context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_getColorLabel(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_getColorLabel(context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_getColorLabel(const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getColorLabel(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getColorLabel(const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getColorLabel(context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getColorLabel(const ::VptDetect::Callback_VptDetectServer_getColorLabelPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getColorLabel(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getColorLabel(const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_getColorLabelPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getColorLabel(context, del, cookie); + } + + ::VptDetect::stringData end_getColorLabel(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_getColorLabel(const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + ::VptDetect::stringDatas getHpResStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_getHpResStr(_iceI_begin_getHpResStr(context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_getHpResStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_getHpResStr(context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_getHpResStr(const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHpResStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHpResStr(const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHpResStr(context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHpResStr(const ::VptDetect::Callback_VptDetectServer_getHpResStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHpResStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHpResStr(const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_getHpResStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHpResStr(context, del, cookie); + } + + ::VptDetect::stringDatas end_getHpResStr(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_getHpResStr(const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + ::VptDetect::stringDatas getHcpResStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return end_getHcpResStr(_iceI_begin_getHcpResStr(context, ::IceInternal::dummyCallback, 0, true)); + } + + ::Ice::AsyncResultPtr begin_getHcpResStr(const ::Ice::Context& context = ::Ice::noExplicitContext) + { + return _iceI_begin_getHcpResStr(context, ::IceInternal::dummyCallback, 0); + } + + ::Ice::AsyncResultPtr begin_getHcpResStr(const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHcpResStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHcpResStr(const ::Ice::Context& context, const ::Ice::CallbackPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHcpResStr(context, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHcpResStr(const ::VptDetect::Callback_VptDetectServer_getHcpResStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHcpResStr(::Ice::noExplicitContext, del, cookie); + } + + ::Ice::AsyncResultPtr begin_getHcpResStr(const ::Ice::Context& context, const ::VptDetect::Callback_VptDetectServer_getHcpResStrPtr& del, const ::Ice::LocalObjectPtr& cookie = 0) + { + return _iceI_begin_getHcpResStr(context, del, cookie); + } + + ::VptDetect::stringDatas end_getHcpResStr(const ::Ice::AsyncResultPtr&); + +private: + + ::Ice::AsyncResultPtr _iceI_begin_getHcpResStr(const ::Ice::Context&, const ::IceInternal::CallbackBasePtr&, const ::Ice::LocalObjectPtr& cookie = 0, bool sync = false); + +public: + + static const ::std::string& ice_staticId(); + +protected: + + virtual ::IceProxy::Ice::Object* _newInstance() const; +}; + +} + +} + +namespace VptDetect +{ + +class VptDetectServer : public virtual ::Ice::Object +{ +public: + + typedef VptDetectServerPrx ProxyType; + typedef VptDetectServerPtr PointerType; + + virtual ~VptDetectServer(); + + virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::emptyCurrent) const; + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::emptyCurrent) const; + virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::emptyCurrent) const; + + static const ::std::string& ice_staticId(); + + virtual ::VptDetect::ObjInfos VptDetect(::Ice::Int, ::Ice::Int, const ::std::string&, const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_VptDetect(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getStr(::Ice::Int, const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_getStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringData getTypeStr(const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_getTypeStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringData getColorLabel(const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_getColorLabel(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getHpResStr(const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_getHpResStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual ::VptDetect::stringDatas getHcpResStr(const ::Ice::Current& = ::Ice::emptyCurrent) = 0; + bool _iceD_getHcpResStr(::IceInternal::Incoming&, const ::Ice::Current&); + + virtual bool _iceDispatch(::IceInternal::Incoming&, const ::Ice::Current&); + +protected: + + virtual void _iceWriteImpl(::Ice::OutputStream*) const; + virtual void _iceReadImpl(::Ice::InputStream*); +}; + +inline bool operator==(const VptDetectServer& lhs, const VptDetectServer& rhs) +{ + return static_cast<const ::Ice::Object&>(lhs) == static_cast<const ::Ice::Object&>(rhs); +} + +inline bool operator<(const VptDetectServer& lhs, const VptDetectServer& rhs) +{ + return static_cast<const ::Ice::Object&>(lhs) < static_cast<const ::Ice::Object&>(rhs); +} + +} + +namespace Ice +{ + +template<> +struct StreamableTraits< ::VptDetect::RECT> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 16; + static const bool fixedLength = true; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::RECT, S> +{ + static void write(S* ostr, const ::VptDetect::RECT& v) + { + ostr->write(v.left); + ostr->write(v.top); + ostr->write(v.width); + ostr->write(v.height); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::RECT, S> +{ + static void read(S* istr, ::VptDetect::RECT& v) + { + istr->read(v.left); + istr->read(v.top); + istr->read(v.width); + istr->read(v.height); + } +}; + +template<> +struct StreamableTraits< ::VptDetect::ClassfyObjRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 8; + static const bool fixedLength = true; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::ClassfyObjRes, S> +{ + static void write(S* ostr, const ::VptDetect::ClassfyObjRes& v) + { + ostr->write(v.res_index); + ostr->write(v.res_prob); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::ClassfyObjRes, S> +{ + static void read(S* istr, ::VptDetect::ClassfyObjRes& v) + { + istr->read(v.res_index); + istr->read(v.res_prob); + } +}; + +template<> +struct StreamableTraits< ::VptDetect::PersonDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 1; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::PersonDetectRes, S> +{ + static void write(S* ostr, const ::VptDetect::PersonDetectRes& v) + { + ostr->write(v.res_objs); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::PersonDetectRes, S> +{ + static void read(S* istr, ::VptDetect::PersonDetectRes& v) + { + istr->read(v.res_objs); + } +}; + +template<> +struct StreamableTraits< ::VptDetect::PerRideCarDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 1; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::PerRideCarDetectRes, S> +{ + static void write(S* ostr, const ::VptDetect::PerRideCarDetectRes& v) + { + ostr->write(v.res_objs); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::PerRideCarDetectRes, S> +{ + static void read(S* istr, ::VptDetect::PerRideCarDetectRes& v) + { + istr->read(v.res_objs); + } +}; + +template<> +struct StreamableTraits< ::VptDetect::CarDetectRes> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 46; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::CarDetectRes, S> +{ + static void write(S* ostr, const ::VptDetect::CarDetectRes& v) + { + ostr->write(v.vehicle_brand); + ostr->write(v.vehicle_subbrand); + ostr->write(v.vehicle_issue_year); + ostr->write(v.vehicle_type); + ostr->write(v.freight_ton); + ostr->write(v.vehicle_score); + ostr->write(v.colorLabel); + ostr->write(v.colorLabelProb); + ostr->write(v.carPlateRect); + ostr->write(v.carPlateRectScore); + ostr->write(v.carPlate); + ostr->write(v.carPlateScore); + ostr->write(v.carPlatetype); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::CarDetectRes, S> +{ + static void read(S* istr, ::VptDetect::CarDetectRes& v) + { + istr->read(v.vehicle_brand); + istr->read(v.vehicle_subbrand); + istr->read(v.vehicle_issue_year); + istr->read(v.vehicle_type); + istr->read(v.freight_ton); + istr->read(v.vehicle_score); + istr->read(v.colorLabel); + istr->read(v.colorLabelProb); + istr->read(v.carPlateRect); + istr->read(v.carPlateRectScore); + istr->read(v.carPlate); + istr->read(v.carPlateScore); + istr->read(v.carPlatetype); + } +}; + +template<> +struct StreamableTraits< ::VptDetect::VptDetectResult> +{ + static const StreamHelperCategory helper = StreamHelperCategoryStruct; + static const int minWireSize = 68; + static const bool fixedLength = false; +}; + +template<typename S> +struct StreamWriter< ::VptDetect::VptDetectResult, S> +{ + static void write(S* ostr, const ::VptDetect::VptDetectResult& v) + { + ostr->write(v.sdkDetectType); + ostr->write(v.bskRect); + ostr->write(v.personDetectRes); + ostr->write(v.perRideCarDetectRes); + ostr->write(v.carDetectRes); + } +}; + +template<typename S> +struct StreamReader< ::VptDetect::VptDetectResult, S> +{ + static void read(S* istr, ::VptDetect::VptDetectResult& v) + { + istr->read(v.sdkDetectType); + istr->read(v.bskRect); + istr->read(v.personDetectRes); + istr->read(v.perRideCarDetectRes); + istr->read(v.carDetectRes); + } +}; + +} + +namespace VptDetect +{ + +template<class T> +class CallbackNC_VptDetectServer_VptDetect : public Callback_VptDetectServer_VptDetect_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::ObjInfos&); + + CallbackNC_VptDetectServer_VptDetect(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::ObjInfos ret; + try + { + ret = proxy->end_VptDetect(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_VptDetectPtr +newCallback_VptDetectServer_VptDetect(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::ObjInfos&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_VptDetect<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_VptDetectPtr +newCallback_VptDetectServer_VptDetect(T* instance, void (T::*cb)(const ::VptDetect::ObjInfos&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_VptDetect<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_VptDetect : public Callback_VptDetectServer_VptDetect_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::ObjInfos&, const CT&); + + Callback_VptDetectServer_VptDetect(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::ObjInfos ret; + try + { + ret = proxy->end_VptDetect(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_VptDetectPtr +newCallback_VptDetectServer_VptDetect(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::ObjInfos&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_VptDetect<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_VptDetectPtr +newCallback_VptDetectServer_VptDetect(T* instance, void (T::*cb)(const ::VptDetect::ObjInfos&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_VptDetect<T, CT>(instance, cb, excb, sentcb); +} + +template<class T> +class CallbackNC_VptDetectServer_getStr : public Callback_VptDetectServer_getStr_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::stringDatas&); + + CallbackNC_VptDetectServer_getStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_getStrPtr +newCallback_VptDetectServer_getStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getStr<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_getStrPtr +newCallback_VptDetectServer_getStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getStr<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_getStr : public Callback_VptDetectServer_getStr_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::stringDatas&, const CT&); + + Callback_VptDetectServer_getStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_getStrPtr +newCallback_VptDetectServer_getStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_getStrPtr +newCallback_VptDetectServer_getStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T> +class CallbackNC_VptDetectServer_getTypeStr : public Callback_VptDetectServer_getTypeStr_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::stringData&); + + CallbackNC_VptDetectServer_getTypeStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringData ret; + try + { + ret = proxy->end_getTypeStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_getTypeStrPtr +newCallback_VptDetectServer_getTypeStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringData&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getTypeStr<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_getTypeStrPtr +newCallback_VptDetectServer_getTypeStr(T* instance, void (T::*cb)(const ::VptDetect::stringData&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getTypeStr<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_getTypeStr : public Callback_VptDetectServer_getTypeStr_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::stringData&, const CT&); + + Callback_VptDetectServer_getTypeStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringData ret; + try + { + ret = proxy->end_getTypeStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_getTypeStrPtr +newCallback_VptDetectServer_getTypeStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringData&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getTypeStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_getTypeStrPtr +newCallback_VptDetectServer_getTypeStr(T* instance, void (T::*cb)(const ::VptDetect::stringData&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getTypeStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T> +class CallbackNC_VptDetectServer_getColorLabel : public Callback_VptDetectServer_getColorLabel_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::stringData&); + + CallbackNC_VptDetectServer_getColorLabel(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringData ret; + try + { + ret = proxy->end_getColorLabel(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_getColorLabelPtr +newCallback_VptDetectServer_getColorLabel(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringData&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getColorLabel<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_getColorLabelPtr +newCallback_VptDetectServer_getColorLabel(T* instance, void (T::*cb)(const ::VptDetect::stringData&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getColorLabel<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_getColorLabel : public Callback_VptDetectServer_getColorLabel_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::stringData&, const CT&); + + Callback_VptDetectServer_getColorLabel(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringData ret; + try + { + ret = proxy->end_getColorLabel(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_getColorLabelPtr +newCallback_VptDetectServer_getColorLabel(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringData&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getColorLabel<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_getColorLabelPtr +newCallback_VptDetectServer_getColorLabel(T* instance, void (T::*cb)(const ::VptDetect::stringData&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getColorLabel<T, CT>(instance, cb, excb, sentcb); +} + +template<class T> +class CallbackNC_VptDetectServer_getHpResStr : public Callback_VptDetectServer_getHpResStr_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::stringDatas&); + + CallbackNC_VptDetectServer_getHpResStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getHpResStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_getHpResStrPtr +newCallback_VptDetectServer_getHpResStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getHpResStr<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_getHpResStrPtr +newCallback_VptDetectServer_getHpResStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getHpResStr<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_getHpResStr : public Callback_VptDetectServer_getHpResStr_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::stringDatas&, const CT&); + + Callback_VptDetectServer_getHpResStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getHpResStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_getHpResStrPtr +newCallback_VptDetectServer_getHpResStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getHpResStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_getHpResStrPtr +newCallback_VptDetectServer_getHpResStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getHpResStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T> +class CallbackNC_VptDetectServer_getHcpResStr : public Callback_VptDetectServer_getHcpResStr_Base, public ::IceInternal::TwowayCallbackNC<T> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception&); + typedef void (T::*Sent)(bool); + typedef void (T::*Response)(const ::VptDetect::stringDatas&); + + CallbackNC_VptDetectServer_getHcpResStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallbackNC<T>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getHcpResStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::CallbackNC<T>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::CallbackNC<T>::_callback.get()->*_response)(ret); + } + } + +private: + + Response _response; +}; + +template<class T> Callback_VptDetectServer_getHcpResStrPtr +newCallback_VptDetectServer_getHcpResStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getHcpResStr<T>(instance, cb, excb, sentcb); +} + +template<class T> Callback_VptDetectServer_getHcpResStrPtr +newCallback_VptDetectServer_getHcpResStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&), void (T::*excb)(const ::Ice::Exception&), void (T::*sentcb)(bool) = 0) +{ + return new CallbackNC_VptDetectServer_getHcpResStr<T>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> +class Callback_VptDetectServer_getHcpResStr : public Callback_VptDetectServer_getHcpResStr_Base, public ::IceInternal::TwowayCallback<T, CT> +{ +public: + + typedef IceUtil::Handle<T> TPtr; + + typedef void (T::*Exception)(const ::Ice::Exception& , const CT&); + typedef void (T::*Sent)(bool , const CT&); + typedef void (T::*Response)(const ::VptDetect::stringDatas&, const CT&); + + Callback_VptDetectServer_getHcpResStr(const TPtr& obj, Response cb, Exception excb, Sent sentcb) + : ::IceInternal::TwowayCallback<T, CT>(obj, cb != 0, excb, sentcb), _response(cb) + { + } + + virtual void completed(const ::Ice::AsyncResultPtr& result) const + { + ::VptDetect::VptDetectServerPrx proxy = ::VptDetect::VptDetectServerPrx::uncheckedCast(result->getProxy()); + ::VptDetect::stringDatas ret; + try + { + ret = proxy->end_getHcpResStr(result); + } + catch(const ::Ice::Exception& ex) + { + ::IceInternal::Callback<T, CT>::exception(result, ex); + return; + } + if(_response) + { + (::IceInternal::Callback<T, CT>::_callback.get()->*_response)(ret, CT::dynamicCast(result->getCookie())); + } + } + +private: + + Response _response; +}; + +template<class T, typename CT> Callback_VptDetectServer_getHcpResStrPtr +newCallback_VptDetectServer_getHcpResStr(const IceUtil::Handle<T>& instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getHcpResStr<T, CT>(instance, cb, excb, sentcb); +} + +template<class T, typename CT> Callback_VptDetectServer_getHcpResStrPtr +newCallback_VptDetectServer_getHcpResStr(T* instance, void (T::*cb)(const ::VptDetect::stringDatas&, const CT&), void (T::*excb)(const ::Ice::Exception&, const CT&), void (T::*sentcb)(bool, const CT&) = 0) +{ + return new Callback_VptDetectServer_getHcpResStr<T, CT>(instance, cb, excb, sentcb); +} + +} + +#endif + +#include <IceUtil/PopDisableWarnings.h> +#endif diff --git a/QiaoJiaSystem/VptServer/rpc/VptServer.ice b/QiaoJiaSystem/VptServer/rpc/VptServer.ice new file mode 100644 index 0000000..2969b88 --- /dev/null +++ b/QiaoJiaSystem/VptServer/rpc/VptServer.ice @@ -0,0 +1,71 @@ +module VptDetect +{ + struct RECT + { + float left; + float top; + float width; + float height; + } + struct ClassfyObjRes { + int res_index; //鍒嗙被缁撴灉 + float res_prob; //鍒嗙被缁撴瀯浣� + }; + + sequence<ClassfyObjRes> ResObjs; + + struct PersonDetectRes { + ResObjs res_objs; //鍒嗙被缁撴灉 + }; + + struct PerRideCarDetectRes { + ResObjs res_objs; //鍒嗙被缁撴灉 + }; + + struct CarDetectRes { + //杞﹀瀷璇嗗埆缁撴灉 + string vehicle_brand; //杞﹁締鍝佺墝 + string vehicle_subbrand; //杞﹁締瀛愬搧鐗� + string vehicle_issue_year; //杞﹁締骞存 + string vehicle_type; //杞﹁締绫诲瀷 + string freight_ton; //璐ц溅鍚ㄧ骇 + float vehicle_score; //杞﹀瀷璇嗗埆缃俊搴� + + //杞﹂鑹茶瘑鍒粨鏋� + int colorLabel; //杞﹂鑹� + float colorLabelProb; //杞﹂鑹茬疆淇″害 + + //杞︾墝妫�娴嬬粨鏋� + RECT carPlateRect; //杞︾墝鍖哄煙 + float carPlateRectScore; //杞︾墝鍖哄煙缃俊搴� + string carPlate; //杞︾墝 + float carPlateScore; //杞︾墝缃俊搴� + int carPlatetype; + }; + + struct VptDetectResult { + int sdkDetectType; + RECT bskRect; + PersonDetectRes personDetectRes; + PerRideCarDetectRes perRideCarDetectRes; + CarDetectRes carDetectRes; + }; + + sequence<VptDetectResult> ObjInfos; + + sequence<string> stringData; + sequence<stringData> stringDatas; + + interface VptDetectServer + { + ObjInfos VptDetect(int width, int height, string shareMemory); + + // + stringDatas getStr(int type); + // + stringData getTypeStr(); + stringData getColorLabel(); + stringDatas getHpResStr(); + stringDatas getHcpResStr(); + } +} diff --git a/QiaoJiaSystem/VptServer/rpc/gen.sh b/QiaoJiaSystem/VptServer/rpc/gen.sh new file mode 100644 index 0000000..c53310b --- /dev/null +++ b/QiaoJiaSystem/VptServer/rpc/gen.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +./../../../BasicPlatForm/libs/Ice-3.7.0/bin/slice2cpp VptServer.ice diff --git a/QiaoJiaSystem/build/runAll.sh b/QiaoJiaSystem/build/runAll.sh index 455ddea..67ce9e0 100644 --- a/QiaoJiaSystem/build/runAll.sh +++ b/QiaoJiaSystem/build/runAll.sh @@ -7,7 +7,7 @@ MYLOGPATH="/home/basic/work/log/" #todo -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64:${MY3RDLIBSPATH}/hcTool/HCNetSDK64/lib:${MY3RDLIBSPATH}/hcTool/HCNetSDK64/lib/HCNetSDKCom:${MY3RDLIBSPATH}/ffmpeg/lib:${MY3RDLIBSPATH}/opencv/lib:${MY3RDLIBSPATH}/Casia_Face/FaceSdk/lib/gpu:${MY3RDLIBSPATH}/FastDFS/lib:${MY3RDLIBSPATH}/Ice-3.7.0/lib64:${MY3RDLIBSPATH}/DarkNet/lib:${MY3RDLIBSPATH}/libopenssl/lib:${MY3RDLIBSPATH}/uniview/lib:${MY3RDLIBSPATH}/libboost/lib/:${MY3RDLIBSPATH}/sqlite/lib/:${MY3RDLIBSPATH}/glog/lib/:${MY3RDLIBSPATH}/hiredis-master/lib:${MY3RDLIBSPATH}/mysql/lib:${MY3RDLIBSPATH}/mysqlpp/lib:${MY3RDLIBSPATH}/GB28181/libs:${MY3RDLIBSPATH}/EvnsqTool/lib:${MY3RDLIBSPATH}/libevent/lib +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64:${MY3RDLIBSPATH}/hcTool/HCNetSDK64/lib:${MY3RDLIBSPATH}/hcTool/HCNetSDK64/lib/HCNetSDKCom:${MY3RDLIBSPATH}/ffmpeg/lib:${MY3RDLIBSPATH}/opencv/lib:${MY3RDLIBSPATH}/Casia_Face/FaceSdk/lib/gpu:${MY3RDLIBSPATH}/FastDFS/lib:${MY3RDLIBSPATH}/Ice-3.7.0/lib64:${MY3RDLIBSPATH}/DarkNet/lib:${MY3RDLIBSPATH}/libopenssl/lib:${MY3RDLIBSPATH}/uniview/lib:${MY3RDLIBSPATH}/libboost/lib/:${MY3RDLIBSPATH}/sqlite/lib/:${MY3RDLIBSPATH}/glog/lib/:${MY3RDLIBSPATH}/hiredis-master/lib:${MY3RDLIBSPATH}/mysql/lib:${MY3RDLIBSPATH}/mysqlpp/lib:${MY3RDLIBSPATH}/GB28181/libs startFunc() { PROC=`ps aux | grep "$1" | grep -v grep | grep -v tail` @@ -159,14 +159,14 @@ rm -rfd ${MYLOGPATH}/VideoAnalysFromHC/* startVAHK VideoAnalysFromHC 0 1 0 1 10001 10011 10021 10031 10041 startVAHK VideoAnalysFromHC 0 0 2 3 10002 10012 10022 10032 10042 - startVAHK VideoAnalysFromHC 1 1 0 3 10003 10013 10023 10033 10043 + startVAHK VideoAnalysFromHC 1 1 0 4 10003 10013 10023 10033 10043 # startVAHK VideoAnalysFromHC 0 0 12 15 10004 10014 10024 10034 10044 else echo "VideoAnalysFromHC is exists" fi -cd ${MY3RDLIBSPATH}/srs +cd /home/basic/Apps/BasicPlatForm/libs/srs nohup ./runRtmpServer.sh & cd /usr/local/redis/bin -- Gitblit v1.8.0