| | |
| | | #include <THFeature_i.h> |
| | | |
| | | FaceExtractServerI::FaceExtractServerI() { |
| | | 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++) { |
| | | extractResourcesManager.pushResource(i); |
| | | } |
| | |
| | | FaceDetect::Data FaceExtractServerI::faceExtract(Ice::Int width, Ice::Int height, const FaceDetect::FacePos &pos, |
| | | const std::string &shareMemoryName, const Ice::Current &) { |
| | | ClockTimer ct("FaceExtractServerI::faceExtract"); |
| | | INFO("faceExtract"); |
| | | QSharedMemory shareMemory(QString(shareMemoryName.c_str())); |
| | | FaceDetect::Data feature; |
| | | if (shareMemory.attach()) { |
| | |
| | | } |
| | | return feature; |
| | | } else { |
| | | throw std::runtime_error("shareMemory attach faild"); |
| | | ERR("shareMemory attach faild"); |
| | | // throw std::runtime_error("shareMemory attach faild"); |
| | | } |
| | | |
| | | } |