xuxiuxi
2017-04-25 fe86d1a65b1d7c78384f22db2e5cf09ffe8ad7a1
FaceServer/STFaceCache.cpp
@@ -9,6 +9,8 @@
#include "sample_face_search.h"
#include <cv_face.h>
#define ENABLE_AUTO_CREATE_STFACEDB
struct STFaceCacheContext
{
   cv_handle_t handle_verify;
@@ -152,6 +154,8 @@
      bool ret = ctx.init_db(cacheContext);
      LOG_INFO << "init stface db dbid=" << ctx.dbid << ", ret=" << ret << LOG_ENDL;
   }
   return true;
}
void STFaceCache::close_dbs()
@@ -222,6 +226,8 @@
   }
   
   stface_ctx_map_t::iterator iterCtx = dbContext.find(img.db_id);
#ifdef ENABLE_AUTO_CREATE_STFACEDB
   if (iterCtx == dbContext.end())
   {
      // create db
@@ -247,6 +253,7 @@
      dbContext.insert(std::make_pair(ctx.dbid, ctx));
      iterCtx = dbContext.find(img.db_id);
   }
#endif
   
   if (iterCtx == dbContext.end())
   {