Skip to content

Commit 0f9268b

Browse files
committed
fix: add comprehensive English Javadoc
1 parent 5d98631 commit 0f9268b

3 files changed

Lines changed: 133 additions & 0 deletions

File tree

src/main/java/com/arcsoft/face/spring/boot/ArcFaceRecognitionAutoConfiguration.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,33 @@
1515
/**\n * Auto-configuration for ArcFace face recognition SDK.\n *\n * @author <a href="https://github.com/loong10k">Loong Wan</a>\n * @since 1.0.0\n */
1616
public class ArcFaceRecognitionAutoConfiguration {
1717

18+
/**
19+
* <p>face engine factory.</p>
20+
* @param properties the properties
21+
* @return the faceEngineFactory return value
22+
*/
1823
@Bean
1924
public FaceEngineFactory faceEngineFactory(ArcFaceRecognitionProperties properties) {
2025
return new FaceEngineFactory(properties);
2126
}
2227

28+
/**
29+
* <p>face engine object pool.</p>
30+
* @param faceEngineFactory the face engine factory
31+
* @param properties the properties
32+
* @return the faceEngineObjectPool return value
33+
*/
2334
@Bean
2435
public GenericObjectPool<FaceEngine> faceEngineObjectPool(FaceEngineFactory faceEngineFactory, ArcFaceRecognitionProperties properties) {
2536
return new GenericObjectPool<FaceEngine>(faceEngineFactory, properties.getPool2());
2637
}
2738

39+
/**
40+
* <p>arc face recognition template.</p>
41+
* @param properties the properties
42+
* @param faceEngineObjectPool the face engine object pool
43+
* @return the arcFaceRecognitionTemplate return value
44+
*/
2845
@Bean
2946
public ArcFaceRecognitionTemplate arcFaceRecognitionTemplate(ArcFaceRecognitionProperties properties,
3047
GenericObjectPool<FaceEngine> faceEngineObjectPool) {

src/main/java/com/arcsoft/face/spring/boot/ArcFaceRecognitionProperties.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
import com.arcsoft.face.EngineConfiguration;
2222
import com.arcsoft.face.FaceEngine;
2323

24+
/**
25+
* <p>Configuration properties for ArcFaceRecognition.</p>
26+
*
27+
* @author <a href="https://github.com/loong10k">Loong Wan</a>
28+
* @since 1.0.0
29+
*/
2430
@ConfigurationProperties(ArcFaceRecognitionProperties.PREFIX)
2531
public class ArcFaceRecognitionProperties extends EngineConfiguration {
2632

@@ -48,42 +54,52 @@ public class ArcFaceRecognitionProperties extends EngineConfiguration {
4854
private GenericObjectPoolConfig<FaceEngine> pool2 = new GenericObjectPoolConfig<FaceEngine>();
4955

5056

57+
/** Getter for enabled */
5158
public boolean isEnabled() {
5259
return enabled;
5360
}
5461

62+
/** Setter for enabled */
5563
public void setEnabled(boolean enabled) {
5664
this.enabled = enabled;
5765
}
5866

67+
/** Getter for app id */
5968
public String getAppId() {
6069
return appId;
6170
}
6271

72+
/** Setter for app id */
6373
public void setAppId(String appId) {
6474
this.appId = appId;
6575
}
6676

77+
/** Getter for sdk key */
6778
public String getSdkKey() {
6879
return sdkKey;
6980
}
7081

82+
/** Setter for sdk key */
7183
public void setSdkKey(String sdkKey) {
7284
this.sdkKey = sdkKey;
7385
}
7486

87+
/** Getter for lib path */
7588
public String getLibPath() {
7689
return libPath;
7790
}
7891

92+
/** Setter for lib path */
7993
public void setLibPath(String libPath) {
8094
this.libPath = libPath;
8195
}
8296

97+
/** Getter for pool2 */
8398
public GenericObjectPoolConfig<FaceEngine> getPool2() {
8499
return pool2;
85100
}
86101

102+
/** Setter for pool2 */
87103
public void setPool2(GenericObjectPoolConfig<FaceEngine> pool2) {
88104
this.pool2 = pool2;
89105
}

src/main/java/com/arcsoft/face/spring/boot/ArcFaceRecognitionTemplate.java

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ public ArcFaceRecognitionTemplate(ArcFaceRecognitionProperties properties,
5757
this.faceEngineObjectPool = faceEngineObjectPool;
5858
}
5959

60+
/** Getter for message */
6061
protected String getMessage(int code) {
6162
return messages.getMessage("K" + code);
6263
}
6364

6465
/*
6566
* 不同的控制度下所对应的活体控制阈值,如果检测出来的活体分数小于控制阈值,则会返回错误信息。 LOW 0.05 NORMAL 0.3 HIGH 0.9
6667
*/
68+
/** Setter for liveness param */
6769
protected int setLivenessParam(FaceEngine faceEngine, FaceLiveness liveness, JSONObject result) {
6870
switch (liveness) {
6971
case LOW: {
@@ -91,6 +93,11 @@ protected int setLivenessParam(FaceEngine faceEngine, FaceLiveness liveness, JSO
9193
* @author <a href="https://github.com/loong10k">Loong Wan</a>
9294
* @return
9395
*/
96+
/**
97+
* <p>detect.</p>
98+
* @param imageBytes the image bytes
99+
* @return the detect return value
100+
*/
94101
public JSONObject detect(byte[] imageBytes) {
95102
return detect(ImageFactory.getRGBData(imageBytes), FaceLiveness.NONE);
96103
}
@@ -102,6 +109,12 @@ public JSONObject detect(byte[] imageBytes) {
102109
* @author <a href="https://github.com/loong10k">Loong Wan</a>
103110
* @return
104111
*/
112+
/**
113+
* <p>detect.</p>
114+
* @param imageBytes the image bytes
115+
* @param liveness the liveness
116+
* @return the detect return value
117+
*/
105118
public JSONObject detect(byte[] imageBytes, FaceLiveness liveness) {
106119
return detect(ImageFactory.getRGBData(imageBytes), liveness);
107120
}
@@ -113,6 +126,11 @@ public JSONObject detect(byte[] imageBytes, FaceLiveness liveness) {
113126
* @author <a href="https://github.com/loong10k">Loong Wan</a>
114127
* @return
115128
*/
129+
/**
130+
* <p>detect.</p>
131+
* @param imageInfo the image info
132+
* @return the detect return value
133+
*/
116134
public JSONObject detect(ImageInfo imageInfo) {
117135
return detect(imageInfo, FaceLiveness.NONE);
118136
}
@@ -124,6 +142,12 @@ public JSONObject detect(ImageInfo imageInfo) {
124142
* @author <a href="https://github.com/loong10k">Loong Wan</a>
125143
* @return
126144
*/
145+
/**
146+
* <p>detect.</p>
147+
* @param imageInfo the image info
148+
* @param liveness the liveness
149+
* @return the detect return value
150+
*/
127151
public JSONObject detect(ImageInfo imageInfo, FaceLiveness liveness) {
128152

129153
JSONObject result = new JSONObject();
@@ -267,6 +291,12 @@ public JSONObject detect(ImageInfo imageInfo, FaceLiveness liveness) {
267291
* @author <a href="https://github.com/loong10k">Loong Wan</a>
268292
* @return
269293
*/
294+
/**
295+
* <p>ir detect.</p>
296+
* @param imageBytes the image bytes
297+
* @param liveness the liveness
298+
* @return the irDetect return value
299+
*/
270300
public JSONObject irDetect(byte[] imageBytes, FaceLiveness liveness) {
271301
return irDetect(ImageFactory.getGrayData(imageBytes), liveness);
272302
}
@@ -278,6 +308,12 @@ public JSONObject irDetect(byte[] imageBytes, FaceLiveness liveness) {
278308
* @author <a href="https://github.com/loong10k">Loong Wan</a>
279309
* @return
280310
*/
311+
/**
312+
* <p>ir detect.</p>
313+
* @param imageInfo the image info
314+
* @param liveness the liveness
315+
* @return the irDetect return value
316+
*/
281317
public JSONObject irDetect(ImageInfo imageInfo, FaceLiveness liveness) {
282318

283319
JSONObject result = new JSONObject();
@@ -416,6 +452,13 @@ public JSONObject irDetect(ImageInfo imageInfo, FaceLiveness liveness) {
416452
return null;
417453
}
418454

455+
/**
456+
* <p>match.</p>
457+
* @param sourceImage the source image
458+
* @param feature the feature
459+
* @param liveness the liveness
460+
* @return the match return value
461+
*/
419462
public JSONObject match(ImageInfo sourceImage, byte[] feature, FaceLiveness liveness) {
420463

421464
JSONObject result = new JSONObject();
@@ -499,10 +542,24 @@ public JSONObject match(ImageInfo sourceImage, byte[] feature, FaceLiveness live
499542
}
500543
}
501544

545+
/**
546+
* <p>match.</p>
547+
* @param sourceImage the source image
548+
* @param targetImage the target image
549+
* @param liveness the liveness
550+
* @return the match return value
551+
*/
502552
public JSONObject match(byte[] sourceImage, byte[] targetImage, FaceLiveness liveness) {
503553
return match(ImageFactory.getRGBData(sourceImage), ImageFactory.getRGBData(targetImage), liveness);
504554
}
505555

556+
/**
557+
* <p>match.</p>
558+
* @param sourceImage the source image
559+
* @param targetImage the target image
560+
* @param liveness the liveness
561+
* @return the match return value
562+
*/
506563
public JSONObject match(ImageInfo sourceImage, ImageInfo targetImage, FaceLiveness liveness) {
507564

508565
JSONObject result = new JSONObject();
@@ -608,14 +665,32 @@ public JSONObject match(ImageInfo sourceImage, ImageInfo targetImage, FaceLivene
608665
}
609666
}
610667

668+
/**
669+
* <p>ir search.</p>
670+
* @param sourceImage the source image
671+
* @param searchImage the search image
672+
* @return the irSearch return value
673+
*/
611674
public JSONObject irSearch(byte[] sourceImage, byte[] searchImage) {
612675
return search(ImageFactory.getGrayData(sourceImage), ImageFactory.getGrayData(searchImage));
613676
}
614677

678+
/**
679+
* <p>search.</p>
680+
* @param sourceImage the source image
681+
* @param searchImage the search image
682+
* @return the search return value
683+
*/
615684
public JSONObject search(byte[] sourceImage, byte[] searchImage) {
616685
return search(ImageFactory.getRGBData(sourceImage), ImageFactory.getRGBData(searchImage));
617686
}
618687

688+
/**
689+
* <p>search.</p>
690+
* @param sourceImage the source image
691+
* @param searchImage the search image
692+
* @return the search return value
693+
*/
619694
public JSONObject search(ImageInfo sourceImage, ImageInfo searchImage) {
620695

621696
JSONObject result = new JSONObject();
@@ -709,10 +784,22 @@ public JSONObject search(ImageInfo sourceImage, ImageInfo searchImage) {
709784
}
710785
}
711786

787+
/**
788+
* <p>verify.</p>
789+
* @param imageBytes the image bytes
790+
* @param liveness the liveness
791+
* @return the verify return value
792+
*/
712793
public JSONObject verify(byte[] imageBytes, FaceLiveness liveness) {
713794
return verify(ImageFactory.getRGBData(imageBytes), liveness);
714795
}
715796

797+
/**
798+
* <p>verify.</p>
799+
* @param imageInfo the image info
800+
* @param liveness the liveness
801+
* @return the verify return value
802+
*/
716803
public JSONObject verify(ImageInfo imageInfo, FaceLiveness liveness) {
717804

718805
JSONObject result = new JSONObject();
@@ -794,6 +881,12 @@ public JSONObject verify(ImageInfo imageInfo, FaceLiveness liveness) {
794881
}
795882
}
796883

884+
/**
885+
* <p>ir verify.</p>
886+
* @param imageBytes the image bytes
887+
* @param liveness the liveness
888+
* @return the irVerify return value
889+
*/
797890
public JSONObject irVerify(byte[] imageBytes, FaceLiveness liveness) {
798891
return irVerify(ImageFactory.getGrayData(imageBytes), liveness);
799892
}
@@ -806,6 +899,12 @@ public JSONObject irVerify(byte[] imageBytes, FaceLiveness liveness) {
806899
* @param option 场景信息,程序会视不同的场景选用相对应的模型。当前支持的场景有COMMON(通用场景),GATE(闸机场景),默认使用COMMON
807900
* @return
808901
*/
902+
/**
903+
* <p>ir verify.</p>
904+
* @param imageInfo the image info
905+
* @param liveness the liveness
906+
* @return the irVerify return value
907+
*/
809908
public JSONObject irVerify(ImageInfo imageInfo, FaceLiveness liveness) {
810909

811910
JSONObject result = new JSONObject();
@@ -887,6 +986,7 @@ public JSONObject irVerify(ImageInfo imageInfo, FaceLiveness liveness) {
887986
}
888987
}
889988

989+
/** Getter for properties */
890990
public ArcFaceRecognitionProperties getProperties() {
891991
return properties;
892992
}

0 commit comments

Comments
 (0)