|
@@ -137,33 +137,33 @@ faceLiveness::faceLiveness(FACE_LIVENESS_TYPE livenessType, QWidget *parent) :
|
|
|
m_initTimer->stop();
|
|
|
if(g_faceRecProcPtr == nullptr)
|
|
|
{
|
|
|
- g_faceRecProcPtr = std::make_shared<CFaceRecProc>();
|
|
|
+ g_faceRecProcPtr = std::make_shared<CFaceRecProc>();
|
|
|
+ }
|
|
|
|
|
|
- if (!g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
|
|
|
+ if (!g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
|
|
|
+ {
|
|
|
+// if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
{
|
|
|
- if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+ if(!setBaseImage())
|
|
|
{
|
|
|
- if(!setBaseImage())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ShowMsg(QString::fromLocal8Bit("当前考试未底照"), this, MSG_ICON_TYPE::mit_error);
|
|
|
- return;
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
- if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+ else
|
|
|
{
|
|
|
- if(!setBaseImage())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ ShowMsg(QString::fromLocal8Bit("当前考试未底照"), this, MSG_ICON_TYPE::mit_error);
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
+// if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+// {
|
|
|
+// if(!setBaseImage())
|
|
|
+// {
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
m_bStartCompare = true;
|
|
|
m_fMaxYaw = 0;
|
|
|
m_fMinYaw = 0;
|
|
@@ -480,48 +480,35 @@ void faceLiveness::on_btn_fl_startVerify_clicked()
|
|
|
{
|
|
|
if(g_faceRecProcPtr == nullptr)
|
|
|
{
|
|
|
- g_faceRecProcPtr = std::make_shared<CFaceRecProc>();
|
|
|
+ g_faceRecProcPtr = std::make_shared<CFaceRecProc>();
|
|
|
+ }
|
|
|
|
|
|
- if (!g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
|
|
|
+ if (!g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
|
|
|
+ {
|
|
|
+// if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
{
|
|
|
- if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+ if(!setBaseImage())
|
|
|
{
|
|
|
- if(!setBaseImage())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
-// QString sFileName = g_appInfoPtr->m_sStudentPhotoPath.right(g_appInfoPtr->m_sStudentPhotoPath.length() - g_appInfoPtr->m_sStudentPhotoPath.lastIndexOf("/") - 1);
|
|
|
-// sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
|
|
|
-// if(!QFile::exists(sFileName))
|
|
|
-// {
|
|
|
-// ShowMsg(QString::fromLocal8Bit("底照下载失败,请检查网络"), this, MSG_ICON_TYPE::mit_error);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-
|
|
|
-// if(!g_faceRecProcPtr->setBaseImage(sFileName))
|
|
|
-// {
|
|
|
-// ShowMsg(g_faceRecProcPtr->errorMsg(), this, MSG_ICON_TYPE::mit_error);
|
|
|
-// return;
|
|
|
-// }
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ShowMsg(QString::fromLocal8Bit("当前考试未底照"), this, MSG_ICON_TYPE::mit_error);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
-
|
|
|
- if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- if(!setBaseImage())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ ShowMsg(QString::fromLocal8Bit("当前考试未底照"), this, MSG_ICON_TYPE::mit_error);
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// if(!g_faceRecProcPtr->hasBaseImage())
|
|
|
+// {
|
|
|
+// if(!setBaseImage())
|
|
|
+// {
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
m_bStartCompare = true;
|
|
|
m_fMaxYaw = 0;
|
|
|
m_fMinYaw = 0;
|
|
@@ -568,7 +555,7 @@ void faceLiveness::initAcionIcon()
|
|
|
movie->start();
|
|
|
}
|
|
|
|
|
|
-void faceLiveness::saveLivenessResult()
|
|
|
+void faceLiveness:: saveLivenessResult()
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -614,6 +601,7 @@ void faceLiveness::saveLivenessResult()
|
|
|
jLiveness["faceCount"] = m_livenessList[i].nFaceCount;
|
|
|
jLiveness["realness"] = m_livenessList[i].nRealness;
|
|
|
jLiveness["similarity"] = m_livenessList[i].fSimilarity;
|
|
|
+ jLiveness["fileUrl"] = m_livenessList[i].sUrl.toStdString();
|
|
|
if (m_livenessList[i].nFaceCount == 0)
|
|
|
{
|
|
|
jLiveness["status"] = STATUS_TYPE::ST_NOT_ONESELF.toStdString();
|
|
@@ -637,7 +625,7 @@ void faceLiveness::saveLivenessResult()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- qDebug() << jLiveness.toStyledString().c_str();
|
|
|
+ myServerLog() << jLiveness.toStyledString().c_str();
|
|
|
CHttpRequestPackage hrp;
|
|
|
hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/saveFaceLiveVerifyResult");
|
|
|
hrp.nRequestType = RequestType::rtSaveFaceLiveVerifyResult;
|
|
@@ -817,6 +805,7 @@ void faceLiveness::onClientExamProcessUploadSign(CClientExamProcessUploadSign pr
|
|
|
{
|
|
|
if(processUpload.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
CHttpRequestPackage hrp;
|
|
|
hrp.sUri = processUpload.sFormUrl;
|
|
|
hrp.nRequestType = RequestType::rtUploadFileToAliyun;
|
|
@@ -843,6 +832,16 @@ void faceLiveness::onClientExamProcessUploadSign(CClientExamProcessUploadSign pr
|
|
|
{
|
|
|
ShowMsg(processUpload.sMessage, this, MSG_ICON_TYPE::mit_error);
|
|
|
}
|
|
|
+
|
|
|
+ if(m_nRetryCount < 4)
|
|
|
+ {
|
|
|
+ saveLivenessResult();
|
|
|
+ m_nRetryCount++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ emit faceLivenessFaild();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -986,6 +985,7 @@ void faceLiveness::onSaveFaceLiveVerifyResult(CBaseResponsePackage res)
|
|
|
{
|
|
|
if (res.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
if (m_pCloseTimer == nullptr)
|
|
|
{
|
|
|
m_pCloseTimer = std::make_shared<QTimer>();
|