Git Product home page Git Product logo

flutter_bdface_collect's Introduction

flutter_bdface_collect

a baidu face offline collect plugin. Only Android and IOS platforms are supported. 【armeabi-v7a、arm64-v8a】

百度人脸离线采集插件,只支持安卓和iOS。【armeabi-v7a、arm64-v8a】

PS: SDK only support armeabi-v7a、arm64-v8a, if want x86, Please select old-sdk

PS: SDK 只支持 armeabi-v7a、arm64-v8a, 如果想使用 x86, 请选择 old-sdk

SDK Version

Platform Version
Android 4.1
iOS 4.1

Preparing for use

PS:已注释隐私授权检查,故使用前请自行检查授权

Android

在 Android 项目的app/src/main/assets 目录下放入百度离线采集SDK的Android授权文件,文件名固定为 idl-license.face-android SDK 会校验 apk 签名,请使用申请授权相符的签名证书

iOS

Info.plistdict 标签内添加以下内容

<key>NSCameraUsageDescription</key>
<string>使用相机</string>

在 iOS 项目的 Runner 目录下放入百度离线采集SDK的iOS授权文件,文件名固定为 idl-license.face-ios,并将文件加入资源 example

Usage

Init 初始化

    late var licenseId;
    if (Platform.isAndroid) licenseId = "demo-face-android";
    else if (Platform.isIOS) licenseId = "demo-face-ios";
    print('开始初始化');
    String? err = await FlutterBdfaceCollect.instance.init(licenseId);
    print('初始化结果${err == null ? '成功' : '失败'}');

Collect 采集

    FaceConfig config = FaceConfig(livenessTypes: Set.from(LivenessType.all.sublist(1, 4)));
    CollectRresult res = await FlutterBdfaceCollect.instance.collect(config);
    print('采集错误结果:${res.error.isNotEmpty} 内容:${res.error}');
    print('采集原图imageCropBase64:${res.imageSrcBase64.isNotEmpty}');
    print('采集抠图imageSrcBase64:${res.imageCropBase64.isNotEmpty}');

UnInit 释放

    FlutterBdfaceCollect.instance.unInit();

常见问题

iOS

  • 编译时报duplicate output file '***********/Runner.app/Assets.car' on task:

    Podfile文件里添加一行

    install! 'cocoapods', :disable_input_output_paths => true

flutter_bdface_collect's People

Contributors

cyjaysong avatar ccwawamiya avatar

Watchers

James Cloos 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.