| | |
| | | ::FaceSearch::FaceResults |
| | | FaceFeatureSearchServerI::faceSearchTopN(const ::FaceSearch::Data &feature, const ::std::string &info_json, |
| | | ::Ice::Int topN, ::Ice::Float score, const ::Ice::Current &) { |
| | | ClockTimer clockTimer("faceSearchTopN " + to_string(score) + " :"); |
| | | ClockTimer clockTimer("faceSearchTopN "); |
| | | INFO("faceSearchTopN start"); |
| | | // #获取线程id去找资源句柄 |
| | | thread::id key = std::this_thread::get_id(); |
| | |
| | | //#todo 非同步库是否需要比较? |
| | | |
| | | DBG("m_faceFCMAP compare start " << it.first); |
| | | // 对比分数,摄像机分数和布控库分数,谁低按谁?暂时不做 |
| | | // if(){ |
| | | // } |
| | | // score |
| | | // 对比函数 |
| | | t_FaceFC->compare(key, &featureData, topN); |
| | | float t_score = atoi(t_tableInfo.cmpThreshold.c_str()) / 100; |
| | | t_FaceFC->compare(key, &featureData, topN, t_score); |
| | | DBG("m_faceFCMAP compare end " << it.first); |
| | | // 获取对比结果 |
| | | auto t_results = t_FaceFC->getTopResult(key); |
| | |
| | | |
| | | value["likePer"] = item.confidence > 0 ? item.confidence : 0.0; |
| | | value["personPicUrl"] = item.imgUrl.size() > 0 ? item.imgUrl : "";//diku tupian |
| | | |
| | | // string strC = item.idcard+ item. |
| | | value["idcard"] = item.idcard.size() > 0 ? item.idcard : "";//diku tupian |
| | | //如果 alarmRet 不为空把 他的值 放入 personIsHub,否则为4 |
| | | // #TODO 如果启用则正常判断,未布控则认为是未知? |
| | |
| | | std::thread thd(dataUpdate, faceFea); |
| | | thd.detach(); |
| | | } |
| | | auto typeInfoCache = faceFea->m_erlangDbTool.findAllTypeInfo(); |
| | | // auto typeInfoCache = faceFea->m_erlangDbTool.findAllTypeInfo(); |
| | | faceFea->m_tableType.clear(); |
| | | string str_config = faceFea->m_erlangDbTool.getConfigJsonString(); |
| | | |
| | |
| | | // tabInfo.bwType = item.second.bwType = typeInfoCache.find(item.first)->second.bwType; |
| | | tabInfo.bwType = item.second.bwType;//= typeInfoCache.find(item.first)->second.bwType; |
| | | tabInfo.createBy = item.second.create_by; |
| | | tabInfo.enabled = item.second.enabled; |
| | | tabInfo.cmpThreshold = item.second.cmpThreshold; |
| | | |
| | | if ((tabInfo.tableName.find("lt_") == 0) && (tabInfo.createBy != appConfig.getStringProperty("erlNode"))) { |
| | | continue; |