| | |
| | | #include "face_daemon_proto.h"
|
| | | #include "sample_face_search.h"
|
| | | #include "STFaceCache.h"
|
| | | #include <PbFaceList.pb.h>
|
| | | #include "PbFaceList.pb.h"
|
| | |
|
| | | #include <signal.h>
|
| | |
|
| | |
| | | ss << "}";
|
| | |
|
| | | std::string output(ss.str());//#todo avoid copy
|
| | | client.sendBuffSize = output.size() + 1;
|
| | | client.sendBuff = new uint8_t[client.sendBuffSize];
|
| | | client.sendBuffSize = output.size();
|
| | | client.sendBuff = new uint8_t[output.size() + 1];
|
| | | strcpy((char*)client.sendBuff, output.c_str());
|
| | | client.deleteSendBuff = true;
|
| | |
|
| | |
| | |
|
| | | EVPHeader* evpHeader = (EVPHeader*)client.recvBuff;
|
| | | FDP_FaceDetectPB* fdpFaceDetectPB = (FDP_FaceDetectPB*)(client.recvBuff + sizeof(EVPHeader));
|
| | | fdpFaceDetectPB->ntoh();
|
| | |
|
| | | PbFaceList pbFaceList;
|
| | | pbFaceList.ParseFromArray(client.recvBuff + sizeof(EVPHeader) + sizeof(FDP_FaceDetectPB), evpHeader->size - sizeof(EVPHeader) - sizeof(FDP_FaceDetectPB));
|
| | |
| | | LOGP(DEBUG, "stfaceImg db_id=%d, mb_type=%d, width=%d, height=%d, size=%d",
|
| | | (int)stfaceImg.db_id, (int)stfaceImg.mb_type, (int)stfaceImg.width, (int)stfaceImg.height, (int)stfaceImg.size);
|
| | |
|
| | | char imgfn[100 * 1024];
|
| | | static int i = 0;
|
| | | sprintf(imgfn, "IMG_%d_%d_w%d_h%d.rgb565", stfaceImg.db_id, ++i, stfaceImg.width, stfaceImg.height);
|
| | | FILE * pFile = fopen(imgfn, "wb");
|
| | | fwrite(stfaceImg.buff, sizeof(char), stfaceImg.size, pFile);
|
| | | fclose(pFile);
|
| | | pFile = nullptr;
|
| | | //char imgfn[100 * 1024];
|
| | | //static int i = 0;
|
| | | //sprintf(imgfn, "IMG_%d_%d_w%d_h%d.rgb565", stfaceImg.db_id, ++i, stfaceImg.width, stfaceImg.height);
|
| | | //FILE * pFile = fopen(imgfn, "wb");
|
| | | //fwrite(stfaceImg.buff, sizeof(char), stfaceImg.size, pFile);
|
| | | //fclose(pFile);
|
| | | //pFile = nullptr;
|
| | |
|
| | | fdr_vec_t result;
|
| | | FDP_FaceDetectResult fdrResult = g_STFaceCache.add(stfaceImg);
|