doum
6 天以前 2b287056e2f59518888d05a1bbc7e5a55fbd84d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
/*
 * Copyright (C) 2018 Baidu, Inc. All Rights Reserved.
 */
package com.example.datalibrary.model;
 
 
import com.baidu.idl.main.facesdk.FaceInfo;
import com.baidu.idl.main.facesdk.model.BDFaceImageInstance;
import com.example.datalibrary.manager.IdentifyResult;
import com.example.datalibrary.model.User;
 
import java.util.ArrayList;
import java.util.List;
 
public class LivenessModel {
 
    private int faceDetectCode;
    private FaceInfo faceInfo = null;
    private FaceInfo [] faceInfos;
    private long irDetectDuration;
    private float irLivenessScore;
    private long depthtLivenessDuration;
    private float rgbLivenessScore;
 
    private float[] rgbLivenessScores;
    private float depthLivenessScore;
    private int liveType;
    private float[] landmarks;
    private byte[] feature;
    private int trackStatus;
    private boolean isRGBLiveStatus;
    private boolean isNIRLiveStatus;
    private boolean isDepthLiveStatus;
    private boolean multiFrame;
    private long irInfraRedDuration;
    float score ;
 
    private int faceSize;
 
    private float[] mouthMaskArray;
 
    public int getFaceSize() {
        return faceSize;
    }
 
    public void setFaceSize(int faceSize) {
        this.faceSize = faceSize;
    }
    public float getScore() {
        return score;
    }
 
    public void setScore(float score) {
        this.score = score;
    }
 
    public long getIrInfraRedDuration() {
        return irInfraRedDuration;
    }
 
    public void setIrInfraRedDuration(long irInfraRedDuration) {
        this.irInfraRedDuration = irInfraRedDuration;
    }
    public long getNirInstanceTime() {
        return nirInstanceTime;
    }
 
    public void setNirInstanceTime(long nirInstanceTime) {
        this.nirInstanceTime = nirInstanceTime;
    }
    public long getAccurateTime() {
        return accurateTime;
    }
 
    public void setAccurateTime(long accurateTime) {
        this.accurateTime = accurateTime;
    }
    public long getTestBDFaceImageInstanceDuration() {
        return testBDFaceImageInstanceDuration;
    }
 
    public void setTestBDFaceImageInstanceDuration(long testBDFaceImageInstanceDuration) {
        this.testBDFaceImageInstanceDuration = testBDFaceImageInstanceDuration;
    }
 
    public boolean isMultiFrame() {
        return multiFrame;
    }
 
    public void setMultiFrame(boolean multiFrame) {
        this.multiFrame = multiFrame;
    }
 
    public boolean isRGBLiveStatus() {
        return isRGBLiveStatus;
    }
 
    public void setRGBLiveStatus(boolean rGBLiveStatus) {
        isRGBLiveStatus = rGBLiveStatus;
    }
 
    public boolean isNIRLiveStatus() {
        return isNIRLiveStatus;
    }
 
    public void setNIRLiveStatus(boolean nIRLiveStatus) {
        isNIRLiveStatus = nIRLiveStatus;
    }
 
    public boolean isDepthLiveStatus() {
        return isDepthLiveStatus;
    }
 
    public void setDepthLiveStatus(boolean depthLiveStatus) {
        isDepthLiveStatus = depthLiveStatus;
    }
 
    public int getTrackStatus() {
        return trackStatus;
    }
 
    public void setTrackStatus(int trackStatus) {
        this.trackStatus = trackStatus;
    }
 
    private float featureScore;
    private float featureCode;
    private String groupId;
    private BDFaceImageInstance bdFaceImageInstance;
    private BDFaceImageInstance bdFaceImageInstanceCrop;
 
    private BDFaceImageInstance bdNirFaceImageInstance;
    private BDFaceImageInstance bdDepthFaceImageInstance;
 
    private User user;
    private int[] shape;
 
    private FaceInfo[] trackFaceInfo;
    private long allDetectDuration;
 
    private float maskScore;
    private long maskScoreDuration;
    private long testBDFaceImageInstanceDuration; // 创建BDFaceImage耗时
    private long darkEnhanceDuration;  // 暗光检测
    private long rgbDetectDuration; // track
    private long multiFrameTime; // 多帧判断
    private long accurateTime; // detect 和质量判断
    private long rgbLivenessDuration; // rgb活体
    private long nirInstanceTime; // 创建nir BDFaceImage耗时
    private long irLivenessDuration; // nir detect
    private long irSilentLiveDuration; // nir 活体
    private long featureDuration; // feature
    private long checkDuration; // featureSearch
    private float[] trackLandmarks;
 
    private List<IdentifyResult> identifyResults = new ArrayList<IdentifyResult>();
 
    public boolean isQualityCheck() {
        return isQualityCheck;
    }
 
    public void setQualityCheck(boolean qualityCheck) {
        isQualityCheck = qualityCheck;
    }
 
    private boolean isQualityCheck; // 是否通过质量检测
    private String isQualityDetect; // 人脸角度 模糊 光照未通过提示
 
    private String isQualityOcclusion; // 遮挡未通过提示
 
    public String getQualityDetect() {
        return isQualityDetect;
    }
 
    public void setQualityDetect(String qualityDetect) {
        isQualityDetect = qualityDetect;
    }
 
    public String getQualityOcclusion() {
        return isQualityOcclusion;
    }
 
    public void setQualityOcclusion(String qualityOcclusion) {
        isQualityOcclusion = qualityOcclusion;
    }
 
    public float[] getTrackLandmarks() {
        return trackLandmarks;
    }
 
    public void setTrackLandmarks(float[] trackLandmarks) {
        this.trackLandmarks = trackLandmarks;
    }
 
    public long getIrSilentLiveDuration() {
        return irSilentLiveDuration;
    }
 
    public void setIrSilentLiveDuration(long irSilentLiveDuration) {
        this.irSilentLiveDuration = irSilentLiveDuration;
    }
 
    public String getGroupId() {
        return groupId;
    }
 
    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }
 
    public long getMultiFrameTime() {
        return multiFrameTime;
    }
 
    public void setMultiFrameTime(long multiFrameTime) {
        this.multiFrameTime = multiFrameTime;
    }
 
 
    public long getDarkEnhanceDuration() {
        return darkEnhanceDuration;
    }
 
    public void setDarkEnhanceDuration(long darkEnhance) {
        this.darkEnhanceDuration = darkEnhance;
    }
 
    public long getMaskScoreDuration() {
        return maskScoreDuration;
    }
 
    public void setMaskScoreDuration(long maskScoreDuration) {
        this.maskScoreDuration = maskScoreDuration;
    }
 
    public float getMaskScore() {
        return maskScore;
    }
 
    public void setMaskScore(float maskScore) {
        this.maskScore = maskScore;
    }
 
    public BDFaceImageInstance getBdFaceImageInstance() {
        return bdFaceImageInstance;
    }
 
    public void setBdFaceImageInstance(BDFaceImageInstance bdFaceImageInstance) {
        this.bdFaceImageInstance = bdFaceImageInstance;
    }
 
    public BDFaceImageInstance getBdFaceImageInstanceCrop() {
        return bdFaceImageInstanceCrop;
    }
 
    public void setBdFaceImageInstanceCrop(BDFaceImageInstance bdFaceImageInstance) {
        this.bdFaceImageInstanceCrop = bdFaceImageInstance;
    }
 
    public long getAllDetectDuration() {
        return allDetectDuration;
    }
 
    public void setAllDetectDuration(long allDetectDuration) {
        this.allDetectDuration = allDetectDuration;
    }
 
 
    public BDFaceImageInstance getBdNirFaceImageInstance() {
        return bdNirFaceImageInstance;
    }
 
    public void setBdNirFaceImageInstance(BDFaceImageInstance bdNirFaceImageInstance) {
        this.bdNirFaceImageInstance = bdNirFaceImageInstance;
    }
 
    public BDFaceImageInstance getBdDepthFaceImageInstance() {
        return bdDepthFaceImageInstance;
    }
 
    public void setBdDepthFaceImageInstance(BDFaceImageInstance bdDepthFaceImageInstance) {
        this.bdDepthFaceImageInstance = bdDepthFaceImageInstance;
    }
    public byte[] getFeature() {
        return feature;
    }
 
    public void setFeature(byte[] feature) {
        this.feature = feature;
    }
 
    public float[] getLandmarks() {
        return landmarks;
    }
 
    public void setLandmarks(float[] landmarks) {
        this.landmarks = landmarks;
    }
 
    public int[] getShape() {
        return shape;
    }
 
    public void setShape(int[] shape) {
        this.shape = shape;
    }
 
 
    public FaceInfo[] getTrackFaceInfo() {
        return trackFaceInfo;
    }
 
    public void setTrackFaceInfo(FaceInfo[] trackFaceInfo) {
        this.trackFaceInfo = trackFaceInfo;
    }
 
 
    public int getFaceDetectCode() {
        return faceDetectCode;
    }
 
    public void setFaceDetectCode(int faceDetectCode) {
        this.faceDetectCode = faceDetectCode;
    }
 
    public FaceInfo getFaceInfo() {
        return faceInfo;
    }
 
    public FaceInfo[] getFaceInfos() {
        return faceInfos;
    }
 
    public void setFaceInfo(FaceInfo faceInfo) {
        this.faceInfo = faceInfo;
    }
 
    public void setFaceInfos(FaceInfo[] faceInfos){
        this.faceInfos = faceInfos;
    }
 
    public long getRgbDetectDuration() {
        return rgbDetectDuration;
    }
 
    public void setRgbDetectDuration(long rgbDetectDuration) {
        this.rgbDetectDuration = rgbDetectDuration;
    }
 
    public long getIrDetectDuration() {
        return irDetectDuration;
    }
 
    public void setIrDetectDuration(long irDetectDuration) {
        this.irDetectDuration = irDetectDuration;
    }
 
    public long getRgbLivenessDuration() {
        return rgbLivenessDuration;
    }
 
    public void setRgbLivenessDuration(long rgbLivenessDuration) {
        this.rgbLivenessDuration = rgbLivenessDuration;
    }
 
    public float getIrLivenessScore() {
        return irLivenessScore;
    }
 
    public void setIrLivenessScore(float irLivenessScore) {
        this.irLivenessScore = irLivenessScore;
    }
 
    public long getIrLivenessDuration() {
        return irLivenessDuration;
    }
 
    public void setIrLivenessDuration(long irLivenessDuration) {
        this.irLivenessDuration = irLivenessDuration;
    }
 
    public long getDepthtLivenessDuration() {
        return depthtLivenessDuration;
    }
 
    public void setDepthtLivenessDuration(long depthtLivenessDuration) {
        this.depthtLivenessDuration = depthtLivenessDuration;
    }
 
    public float getRgbLivenessScore() {
        return rgbLivenessScore;
    }
 
    public float[] getRgbLivenessScores(){
        return rgbLivenessScores;
    }
 
    public void setRgbLivenessScore(float rgbLivenessScore) {
        this.rgbLivenessScore = rgbLivenessScore;
    }
 
    public void setRgbLivenessScores(float [] rgbLivenessScores){
        this.rgbLivenessScores = rgbLivenessScores;
    }
 
    public float getDepthLivenessScore() {
        return depthLivenessScore;
    }
 
    public void setDepthLivenessScore(float depthLivenessScore) {
        this.depthLivenessScore = depthLivenessScore;
    }
 
    public int getLiveType() {
        return liveType;
    }
 
    public void setLiveType(int liveType) {
        this.liveType = liveType;
    }
 
    public float getFeatureScore() {
        return featureScore;
    }
 
    public void setFeatureScore(float featureScore) {
        this.featureScore = featureScore;
    }
 
    public long getFeatureDuration() {
        return featureDuration;
    }
 
    public void setFeatureDuration(long featureDuration) {
        this.featureDuration = featureDuration;
    }
 
    public long getCheckDuration() {
        return checkDuration;
    }
 
    public void setCheckDuration(long checkDuration) {
        this.checkDuration = checkDuration;
    }
 
    public User getUser() {
        return user;
    }
 
    public void setUser(User user) {
        this.user = user;
    }
 
    /**
     * 获取人脸识别结果
     * @return
     */
    public List<IdentifyResult> getIdentifyResults() {
        return identifyResults;
    }
 
    /**
     * 设置人脸识别结果
     * @param identifyResult
     */
    public void addIdentifyResult(final IdentifyResult identifyResult) {
        String userName = identifyResult.user.getUserName();
        int size = identifyResults.size();
        for (int i = 0; i < size; i++) {
            IdentifyResult result = identifyResults.get(i);
            if (result != null && userName.equals(result.user.getUserName())) {
                identifyResults.remove(result);
                break;
            }
        }
        this.identifyResults.add(identifyResult);
    }
 
    /**
     * 清除人脸识别结果
     */
    public void clearIdentifyResults(){
        identifyResults.clear();
    }
 
    public float getFeatureCode() {
        return featureCode;
    }
 
    public void setFeatureCode(float featureCode) {
        this.featureCode = featureCode;
    }
 
    public void setMouthMaskArray(float [] mouthMaskArray){
        this.mouthMaskArray = mouthMaskArray;
    }
 
    public float[] getMouthMaskArray(){
        return mouthMaskArray;
    }
}