From 4cb4bd77e9ae50929f628c36f62a1923c0787f67 Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期三, 28 六月 2017 14:10:07 +0800 Subject: [PATCH] add compare bin proto --- FaceServer/main_face_daemon.cpp | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/FaceServer/main_face_daemon.cpp b/FaceServer/main_face_daemon.cpp index 7aa52a1..039ec87 100644 --- a/FaceServer/main_face_daemon.cpp +++ b/FaceServer/main_face_daemon.cpp @@ -168,21 +168,26 @@ LOGP(DEBUG, "stfaceImg2 db_id=%d, mb_type=%d, width=%d, height=%d, size=%d", (int)stfaceImg2.db_id, (int)stfaceImg2.mb_type, (int)stfaceImg2.width, (int)stfaceImg2.height, (int)stfaceImg2.size); - - - char imgfn[100 * 1024]; - static int i = 0; - sprintf(imgfn, "IMG_%d_%d_w%d_h%d.img", stfaceImg1.db_id, ++i, stfaceImg1.width, stfaceImg1.height); - FILE * pFile = fopen(imgfn, "wb"); - fwrite(stfaceImg1.buff, sizeof(char), stfaceImg1.size, pFile); - fclose(pFile); - pFile = nullptr; - sprintf(imgfn, "IMG_%d_%d_w%d_h%d.img", stfaceImg2.db_id, ++i, stfaceImg2.width, stfaceImg2.height); - pFile = fopen(imgfn, "wb"); - fwrite(stfaceImg2.buff, sizeof(char), stfaceImg2.size, pFile); - fclose(pFile); - pFile = nullptr; + //char imgfn[100 * 1024]; + //static int i = 0; + //sprintf(imgfn, "IMG_%d_%d_w%d_h%d.img", stfaceImg1.db_id, ++i, stfaceImg1.width, stfaceImg1.height); + //FILE * pFile = fopen(imgfn, "wb"); + //fwrite(stfaceImg1.buff, sizeof(char), stfaceImg1.size, pFile); + //fclose(pFile); + //pFile = nullptr; + // + //sprintf(imgfn, "IMG_%d_%d_w%d_h%d.img", stfaceImg2.db_id, ++i, stfaceImg2.width, stfaceImg2.height); + //pFile = fopen(imgfn, "wb"); + //fwrite(stfaceImg2.buff, sizeof(char), stfaceImg2.size, pFile); + //fclose(pFile); + //pFile = nullptr; + + fdr_vec_t result; + FDP_FaceDetectResult fdrResult = g_STFaceCache.compare(stfaceImg1, stfaceImg2); + result.push_back(fdrResult); + + return send_SensetimeFaceDetectResultJson(client, result, 0); } bool ev_dispatcher_proto_pb(EVClientStub& client) -- Gitblit v1.8.0