New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

arcface

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arcface

Arcsoft Face Cognition Engine

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Node-ArcFace

Arcsoft Face Cognition Engine.

ArcFace is a Face Cognition Engine, which contains Face Detection, Face Recognition and Face Tracking.

This module is a wrapper of ArcFace C++ SDK used for nodejs.

Installation

with npm

$ npm install arcface --save

with yarn

$ yarn add arcface

Usage

Using Raw SDK

This way you need to know how to use C/C++ pointer, struct and array in nodejs. See ref.

const ArcFace = require('arcface');

const TypeDef = ArcFace.TypeDef;
const Lib = ArcFace.Lib;

// init FD module
const FD = ArcFace.FD('/path/to/fdsdk.dll');
// init FR module
const FR = ArcFace.FR('/path/to/frsdk.dll');

// setting initial variables
const APPID = 'yourAppId';
const FR_SDKKey = 'yourFRSDKKey';
const WORKBUF_SIZE = 40 * 1024 * 1024;
const nScale = 16;
const nMaxFace = 10;

// alloc memory
const phEngine = TypeDef.Ref.alloc(TypeDef.MHandle);
const pWorkMem = Lib.malloc(WORKBUF_SIZE);

// initial FR Engine
const nRet = FR.AFR_FSDK_InitialEngine(
    APPID, 
    FR_SDKKey, 
    pWorkMem, 
    WORKBUF_SIZE, 
    phEngine
);

// other usages are same as the official sample code
// ...


Using Wrapped SDK

const ArcFace = require('arcface');

const arcface = new ArcFace();

// init FD Engine
arcface.initialFDEngine('/path/to/fd.dll', {
    appId: 'yourAppId',
    sdkKey: 'yourFDKey'
});
// init FR Engine
arcface.initialFREngine('/path/to/fr.dll', {
    appId: 'yourAppId',
    sdkKey: 'yourFRKey'
});

// parse image file to ASVLOFFSCREEN
const asvl = await arcface.parseImage('/path/to/image.jpg');

// face detection
const faces = arcface.detect(asvl);

// extract face featrue
const faceModel = arcface.extractFeature(asvl, faces.rcFace[0], faces.lfaceOrient[0]);

// ...

More see test.

License

MIT

FAQs

Package last updated on 11 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts