lihongtao
2017-07-03 d61e1dda9ead8968665a62dffff1babc93fdc99b
FaceServer/STFaceCache.cpp
@@ -374,23 +374,38 @@
      {
         int16_t new_confidence = it->score * 1000;
         if(topResult.empty())
            topResult.push_back(FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence));
         fdr_vec_t::reverse_iterator rtTR = topResult.rbegin();
         if(!topResult.empty())
         {
            while(new_confidence > rtTR->confidence)
               ++rtTR;
         }
         
         else if(new_confidence > topResult.rbegin()->confidence)
         {
            while(topResult.size() > 4)
               topResult.pop_back();
            for(fdr_vec_t::reverse_iterator rtTR = topResult.rbegin() + 1; rtTR != topResult.rend(); ++rtTR)
            {
               if(new_confidence < rtTR->confidence)
               {
                  fdr_vec_t::iterator itTR(rtTR.base());
                  topResult.insert(itTR, FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence));
               }
            }
         }
         while(topResult.size() > 5)
            topResult.pop_back();
         //if(topResult.empty())
         //   topResult.push_back(FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence));
         //
            //
         //else if(new_confidence > topResult.rbegin()->confidence)
         //{
         //   while(topResult.size() > 4)
         //      topResult.pop_back();
         //   for(fdr_vec_t::reverse_iterator rtTR = topResult.rbegin() + 1; rtTR != topResult.rend(); ++rtTR)
         //   {
         //      if(new_confidence < rtTR->confidence)
         //      {
         //         fdr_vec_t::iterator itTR(rtTR.base());
         //         topResult.insert(itTR, FDP_FaceDetectResult(ctx.dbid, it->idx, new_confidence));
         //      }
         //   }
         //}
      }
      //LOGP(INFO, "stface_search_db return dbid=%d, idx=%d, score=%f", img.db_id, result[0].idx, result[0].score);