From 291dbcd9331cd0df41addef74defa4654ee034fb Mon Sep 17 00:00:00 2001 From: chenshijun <csj_sky@126.com> Date: 星期一, 22 四月 2019 15:59:20 +0800 Subject: [PATCH] 增加人员异常的参数处理 --- QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp index 6380718..dca9d2f 100644 --- a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp +++ b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp @@ -7,8 +7,8 @@ #include <THFaceProperty_i.h> FaceDetectServerI::FaceDetectServerI() { - long threadMax = appPref.getLongData("thread.max"); - long gpuIndex = appPref.getLongData("gpu.index"); + long threadMax = appPref.getIntData("thread.max"); + long gpuIndex = appPref.getIntData("gpu.index"); for (int i = 0; i < threadMax; i++) { detectResourcesManager.pushResource(i); } @@ -43,8 +43,8 @@ FaceDetect::Faces FaceDetectServerI::faceDetect(Ice::Int width, Ice::Int height, const std::string &shareMemoryName, const Ice::Current &) { - ClockTimer ct("FaceDetectServerI::faceDetect"); - INFO("Face Detect"); +// ClockTimer ct("FaceDetectServerI::faceDetect"); +// INFO("Face Detect"); FaceDetect::Faces faces; QSharedMemory shareMemory(QString(shareMemoryName.c_str())); if (shareMemory.attach()) { @@ -53,6 +53,7 @@ int channel = detectResourcesManager.getAvilableChannel(shareMemoryName); int faceNum = THFI_DetectFace(channel, (BYTE *) data, 24, width, height, facesPos, 30, m_ampleSize); if (faceNum > 0) { + DBG("Face num is :" << faceNum); for (int i = 0; i < faceNum; i++) { FaceDetect::FacePos face; auto &pos = facesPos[i]; @@ -63,7 +64,7 @@ faces.push_back(face); } } else { - DBG("Face num is 0"); +// DBG("Face num is 0"); } } else { ERR("shareMemory error " << shareMemoryName); @@ -90,6 +91,7 @@ } return thftResult; } else { - throw std::runtime_error("shareMemory attach faild"); + ERR("shareMemory error " << shareMemoryName); +// throw std::runtime_error("shareMemory attach faild"); } } -- Gitblit v1.8.0