Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - easy-4-java/faceplusplus-java-sdk: Faceplusplus component for easy4j · GitHub
Skip to content

Latest commit

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

faceplusplus-java-sdk

English | 简体中文

JavaLicense

A Java SDK for the Face++ (Megvii) face recognition API. Template-style operations for face detection, analysis, comparison, search, skin analysis and faceset (face group) management, powered by OkHttp 3 and Jackson.

Table of Contents

1. Project Overview

faceplusplus-java-sdk wraps the Face++ REST API (/facepp/v3/*, /facepp/v1/skinanalyze*) in a small template-style API: FaceppTemplate exposes typed operation groups, FaceppFaceOperations / FaceppFacesetOperations implement the calls over FaceppOkHttp3Template (OkHttp 3 + Jackson), and typed response classes model the API results.

What it isWhat it is not
A typed client for the Face++ face recognition APIA Spring Boot starter (no auto-configuration)
Synchronous + async operation variants (face / faceset)A face-detection implementation (images are sent to the Face++ cloud)
URL / Base64 / file input for imagesA general HTTP client framework

Typical use cases:

Use caseOperations
Face detection & analysisdetectUrl/Base64/File, analyze
Face comparisoncompareUrl/Token/Base64/File
Face search in a facesetsearchUrl/Token/Base64/File
Faceset managementcreateFaceset, updateFaceset, getFacesetList, getFacesetByToken/OuterId, addFaceWithToken/OuterId, removeFaceByToken/OuterId, getFaceDetail
Skin analysisskinAnalyzeUrl/Base64/File (basic / advanced / pro)
Async batch face managementFaceppFaceAsyncOperations / FaceppFacesetAsyncOperations

Project status: active development.

2. Features & Status

FeatureStatusNotes
FaceppTemplateAvailableEntry point: opsForFaceDetect() / opsForFaceset()
FaceppFaceOperationsAvailableDetect / analyze / compare / search / skin-analyze with URL, Base64 or File input
FaceppFacesetOperationsAvailableFaceset CRUD, add/remove faces (token or outerId), face detail, set user id
Async variantsAvailableFaceppFaceAsyncOperations, FaceppFacesetAsyncOperations
FaceppOkHttp3TemplateAvailableOkHttp 3 + Jackson HTTP layer: post / get / doRequest overloads, typed response mapping
FaceppPropertiesAvailableHost, app credentials, OSS region, view size, token expiration (default 3600 s)
Typed responsesAvailableFaceDetectResponse, FaceCompareResponse, FaceSearchResponse, Faceset*Response, FaceppResponse.isSuccess(), ...
Request optionsAvailableFaceDetectOptions (landmark, attributes, beauty score range), FaceAnalyzeOptions, FaceSearchOptions, SkinAnalyzeOptions, FacesetBo
Unit testsNot presentNo test sources in the repository
CI pipelineNot configuredNo CI workflow files in the repository

3. Requirements & Compatibility

RequirementVersion
JDK8
Maven3.0+
OkHttp4.9.3
Jackson2.17.2 (jackson-databind)
Face++ APIFace++ v3 face API (api-cn.faceplusplus.com)

Version lines

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

4. Architecture & Modules

 Your code faceplusplus-java-sdk Face++ cloud
--------- --------------------- ------------
FaceppProperties -> FaceppTemplate
|
+--------------+--------------+
| |
FaceppFaceOperations FaceppFacesetOperations
(+Async) (+Async)
| |
+------------> FaceppOkHttp3Template <------------+
(OkHttp 3 + Jackson) |
| |
+--> POST /facepp/v3/* ---+
(api-cn.faceplusplus.com)
|
v
typed response classes (resp/*)

Single module, jar packaging:

PackageResponsibility
com.faceplusplus.spring.bootFaceppTemplate, FaceppProperties, FaceppOkHttp3Template, operation classes, constants
com.faceplusplus.spring.boot.reqTyped request options (FaceDetectOptions, FacesetBo, ...)
com.faceplusplus.spring.boot.respTyped response models (FaceppResponse base, detect/compare/search/faceset responses, ...)

5. Installation

Maven

<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>faceplusplus-java-sdk</artifactId>
<version>2.0.x.x.20260630-SNAPSHOT</version>
</dependency>

Gradle

implementation 'io.github.easy4j:faceplusplus-java-sdk:2.0.x.x.20260630-SNAPSHOT'

Availability: the artifact is published to the Aliyun private Maven repository and distributed through GitHub Releases; it has not yet been published to Maven Central.

6. Quick Start

importcom.faceplusplus.spring.boot.FaceppOkHttp3Template;
importcom.faceplusplus.spring.boot.FaceppProperties;
importcom.faceplusplus.spring.boot.FaceppTemplate;
importcom.faceplusplus.spring.boot.req.FaceDetectOptions;
importcom.faceplusplus.spring.boot.resp.FaceDetectResponse;
importcom.fasterxml.jackson.databind.ObjectMapper;
importokhttp3.OkHttpClient;
FaceppPropertiesproperties = newFaceppProperties();
properties.setAppId("your-app-id");
properties.setAppCertificate("your-api-key");
FaceppOkHttp3Templatehttp = newFaceppOkHttp3Template(newOkHttpClient(), newObjectMapper(), properties);
FaceppTemplatetemplate = newFaceppTemplate(http, properties);
FaceDetectOptionsoptions = FaceDetectOptions.builder()
.returnLandmark(1)
.returnAttributes("gender,age")
.build();
FaceDetectResponseresponse = template.opsForFaceDetect()
.detectUrl("https://example.com/face.jpg", options);
System.out.println("success=" + response.isSuccess());
System.out.println("faces=" + response.getFaces());

Expected result: the detected faces (with landmarks/attributes when requested) are returned in the typed FaceDetectResponse; isSuccess() reflects the Face++ error_message/code contract.

7. Configuration

Configuration is held in FaceppProperties:

PropertyDefaultDescription
hosthttps://api-cn.faceplusplus.comAPI base URL
appIdFace++ API Key
appCertificateFace++ API Secret
expirationTimeInSeconds3600Token expiration (seconds)
loginKey / loginSecretLogin credentials (optional)
ossRegionOSS region for cloud storage (optional)
viewWidth / viewHeightView size (optional)

Credentials are supplied by the application; keep them out of source control.

8. Core Usage / API

8.1 Face operations

// Detect from a local fileFaceDetectResponsedetect = template.opsForFaceDetect()
.detectFile(newFile("face.jpg"), options);
// Compare two images by URLFaceCompareResponsecompare = template.opsForFaceDetect()
.compareUrl("https://a.example/1.jpg", "https://b.example/2.jpg");
// Search within a faceset (by face token)FaceSearchResponsesearch = template.opsForFaceDetect()
.searchToken(faceToken, FaceSearchOptions.builder().returnLandmark(1).build());

8.2 Faceset operations

FacesetBofaceset = newFacesetBo();
faceset.setDisplayName("test set");
faceset.setOuterId("test_set");
faceset.setTags("demo");
FacesetCreateResponsecreated = template.opsForFaceset().createFaceset(faceset);
StringfacesetToken = created.getFacesetToken();
FaceAddResponseadded = template.opsForFaceset()
.addFaceWithToken(facesetToken, "faceToken1", "faceToken2");

8.3 API endpoint coverage

Face++ APISDK method
/facepp/v3/detectdetectUrl/Base64/File
/facepp/v3/face/analyzeanalyze(faceTokens, options)
/facepp/v3/comparecompareUrl/Token/Base64/File
/facepp/v3/searchsearchUrl/Token/Base64/File
`/facepp/v3/faceset/createupdate
`/facepp/v3/faceset/getfacesetsgetdetail`
`/facepp/v3/faceset/addfaceremoveface`
`/facepp/v3/face/setuseridgetdetail`
`/facepp/v3/faceset/async/addfaceremoveface, task_status`
`/facepp/v1/skinanalyze(_advanced_pro)`

Assumption: endpoint constants are maintained in FaceppApiAddress; verify the exact paths against the Face++ console documentation for your API version.

9. Testing & Build

./mvnw clean verify # compile, run tests, generate coverage report
./mvnw clean install # install into the local repository
  • The repository currently contains no test sources.
  • Coverage is measured with the JaCoCo Maven plugin (target: 90% line coverage, haltOnFailure=false).
  • The release profile assembles GPG signing + sources + Javadoc + deployment (./mvnw -Prelease clean deploy).

10. Versioning & Branches

Three parallel version lines are maintained:

BranchJDKVersion pattern
feature/1.0.xJDK 81.0.x.*
feature/2.0.xJDK 172.0.x.*
feature/3.0.xJDK 213.0.x.*

Maintenance strategy: the 1.0.x line receives bug fixes while JDK 8 remains the baseline; feature development primarily targets the 2.0.x / 3.0.x lines.

11. Contributing & License

Contributions are welcome — open an issue or submit a pull request against the matching version-line branch (feature/2.0.x for JDK 17 changes).

This project is licensed under the Apache License, Version 2.0. See the LICENSE file in the repository root for details.

About

Faceplusplus component for easy4j

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages