|
@@ -3,6 +3,8 @@ package cn.com.qmth.examcloud.core.oe.student.test;
|
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelReader;
|
|
|
import cn.com.qmth.examcloud.commons.util.FileUtil;
|
|
|
import cn.com.qmth.examcloud.starters.face.verify.FaceVerifyProperties;
|
|
|
+import cn.com.qmth.examcloud.starters.face.verify.common.FaceResult;
|
|
|
+import cn.com.qmth.examcloud.starters.face.verify.common.JsonHelper;
|
|
|
import cn.com.qmth.examcloud.starters.face.verify.service.impl.FaceVerifyServiceImpl;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.junit.Test;
|
|
@@ -42,13 +44,13 @@ public class FaceVerifyTest {
|
|
|
String excelFile = "C:\\Users\\deason\\Desktop\\比对结果-不通过.xlsx";
|
|
|
List<String[]> lines = ExcelReader.readSheetBySax(excelFile, 1, 8);
|
|
|
|
|
|
- int batchNum = 100;
|
|
|
+ int batchNum = 10;
|
|
|
int totalLines = lines.size() - 1;
|
|
|
List<String[]> batchList = new ArrayList<>();
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
|
for (int n = 1; n < lines.size(); n++) {
|
|
|
- if (n > 500) {
|
|
|
+ if (n > 100) {
|
|
|
// break;
|
|
|
}
|
|
|
|
|
@@ -60,7 +62,7 @@ public class FaceVerifyTest {
|
|
|
batchList.clear();
|
|
|
|
|
|
long cost = (System.currentTimeMillis() - startTime) / 1000L;
|
|
|
- System.out.printf("lineIndex:%s 进度:%s%% 耗时:%s秒 %n", n, n * 100f / totalLines, cost);
|
|
|
+ System.out.printf("lineIndex:%s 进度:%s%% passNum:%s 耗时:%s秒 %n", n, n * 100f / totalLines, passNum.get(), cost);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -103,11 +105,11 @@ public class FaceVerifyTest {
|
|
|
FileUtil.saveImageToFile(capturePhotoUrl, capturePhotoPath);
|
|
|
}
|
|
|
|
|
|
- // FaceResult result = faceVerifyService.faceCompareByBaidu(photoFile, capturePhotoFile);
|
|
|
- // System.out.println(new JsonHelper().toJson(result));
|
|
|
- // if (result.isPass()) {
|
|
|
- passNum.incrementAndGet();
|
|
|
- // }
|
|
|
+ FaceResult result = faceVerifyService.faceCompareByBaidu(photoFile, capturePhotoFile);
|
|
|
+ System.out.println(new JsonHelper().toJson(result));
|
|
|
+ if (result.isPass()) {
|
|
|
+ passNum.incrementAndGet();
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|