FacePlusPlus Java SDK

This SDK use apache.http lib and json lib.

1. Install

  1. download facepp.jar;
  2. add it to java project.

2. Import package

3. Call FaceppAPI

  1. create a com.facepp.http.HttpRequests object

    HttpRequests httpRequests = new HttpRequests(you_api_key_string, you_api_secret_string);

  2. create a com.facepp.http.PostParameters object with all parameters

    PostParameters postParameters = new PostParameters().setUrl("http://faceplusplus.com/static/img/demo/8.jpg").setAttribute("all");

  3. request

    httpRequests.request("detection", "detect", postParameters);

    or

    httpRequests.detectionDetect(postParameters);

  4. get the result use the com.facepp.json.FaceppJson object

    FaceppResult result = httpRequests.detectionDetect(postParameters);

4. Get value from result

5. Debug

  1. View the post request

    postParameters.getMultiPart().writeTo(System.out);

  2. View the result like a pure json

    System.out.println(result)

6. For Android

7. More sample codes