Giter VIP home page Giter VIP logo

facekitdemo's Introduction

人脸SDK相关使用说明

一.使用sdk步骤:

1. 加载jniLibs下so库

2. 加载aar库

  • a. gradle android下新增配置

              repositories {
                  flatDir {
                      dirs 'libs'
                  }
              }
    
  • b. dependencies新增配置

       implementation(name: 'auth-1.0.2', ext: 'aar')
       implementation(name: 'comparator-1.0.2', ext: 'aar')
       implementation(name: 'facekit_v2.8', ext: 'aar')
       implementation(name: 'fakeFace-1.2.0', ext: 'aar')
    

三. 使用前先调用faceKit.setAuth()设置账号,具体见示例代码MainActivity.java

二.sdk接口详细说明:

1. 创建FaceKit对象, 建议单例或者全局唯一

   FaceKit facekit = new FaceKit(context);

2. 设置权限认证

  • 方法定义
    • void setAuth(String userName, String authCode)
  • 方法参数
    • userName 和 authCode是由我司分配的权限认证账号。
  • 方法返回

3. 设置证书下载位置。初次认证需要设置证书,可自定义证书下载位置。

  • 方法定义
    • void setLicencePath(String licencePath)
  • 方法参数
    • licencePath 自定义的证书路径。
  • 方法返回

4. 初始化模型。

  • 方法定义
    • int initModel()
  • 方法参数
  • 方法返回
    • 初始化结果, 为0表示初始化成功

5. 判断是否有人脸。

  • 方法定义
    • ArrayList detectFace(Bitmap bitmap)
  • 方法参数
    • bitmap类型
  • 方法返回
    • 如果无人脸, 返回的是null。如果有人脸, 返回的是人脸的相关特征点位置信息。

6. 获取指定人脸的特征值。

  • 方法定义
    • float[] getFeatureByDetectResult(Bitmap bitmap, DetectResult detectResult)
  • 方法参数
    • bitmap类型的图片, 以及DetectResult类型的相关人脸特征点位置信息
  • 方法返回
    • float[] 类型的人脸特征值

7. 获取指定人脸的特征值(只传图片)。

  • 方法定义
    • ArrayList<float[]> getFeature(Bitmap bitmap, boolean isOnlyFirst)
  • 方法参数
    • bitmap类型的图片, 如果bitmap中有多张人脸, isOnlyFirst 为true表示只获取主要一张人脸特征值
  • 方法返回
    • ArrayList<float[]> 多个float[]人脸特征值集合(与截获的人脸数量相对应)

8. 人脸比对得分(只传两张图片)。

  • 方法定义
    • float compareScore(Bitmap bitmap1, Bitmap bitmap2)
  • 方法参数
    • 两张bitmap类型的图片
  • 方法返回
    • float 比对得分。 如果有一张以上图片无人脸都返回0.0f

9. 人脸比对得分(只传特征值)。

  • 方法定义
    • float compareScore(float[] fea1, float[] fea2)
  • 方法参数
    • 两张图片的特征值
  • 方法返回
    • float 比对得分

10. 静态活体检测接口

  • 方法定义
    • boolean isLive(Bitmap bitmap)
  • 方法参数
    • bitmap图片
  • 方法返回
    • 是或否

facekitdemo's People

Watchers

王江 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.