0.0.53 • Published 4 years ago

ng-naat-liveness v0.0.53

Weekly downloads
256
License
-
Repository
-
Last release
4 years ago

Getting started

Installation

npm install ng-naat-liveness

Dependencies

Add the folder provided by the technical team within the project assets

Import

In the file app.module import the module:

import { NgNaatLivenessModule } from 'ng-naat-liveness';
.
.
.
... imports: [
       ...,
       NgNaatLivenessModule
    ]...

Usage

HTML

Add the selector inside some component and configure the input parameters:

  <ng-naat-liveness-workers
      [gestures]="['LEFT', 'RIGHT', 'LEFT']"
      [timer]="30"
      [videoMirror]="true"
      workerPath='./assets/liveness/worker/'
      modelPath="./assets/liveness/model/model.json"
      (detectionReady)="detectionReady()"
      (calibrationReady)="calibrationReady()"
      (calibrationPercentage)="calibrationPercentage($event)"
      (actionComplete)="actionComplete($event)"
      (processComplete)="processComplete($event)"
      (onerror)="onerror($event)">
    </ng-naat-liveness-workers>

Typescript

Listen to the events:

  detectionReady() {
    // detection ready
  }

  calibrationPercentage(progressPertentage: number) {
    // percentage of calibration
  }

  calibrationReady() {
    // calibration ready
  }

  actionComplete($event) {
    // action completed
  }

  processComplete(image) {
    // process complete 
  }

  onerror($event) {
    // some error
  }

Gestures allowed

NameActionsDescription
LEFTLEFT, FRONTTurn left
RIGHTRIGHT, FRONTTurn right

Inputs

NameTypeRequiredDefaultDescription
gesturesstring[]truenullArray of gestures to execute
modelPathstringtruenullPath of the model.json, this file is included in the dependencies folder
workerPathstringtruenullPath of the worker folder, this folder is included in the dependencies folder
timernumberfalsenullTime in seconds to completed all gestures
maskbooleanfalsetrueView superimposed on the video (background transparent and ellipse)
videoMirrorbooleanfalsetrueShow the camera rotated 180 degrees

Outputs

NameReturnDescription
detectionReadyvoidFires when the browser has loaded dependencies needed to start the process
calibrationReadyvoidFires when face calibration is successfully completed
calibrationPercentagenumberEmit the percentage of calibration progress
actionCompleteResponseActionFires when an action was completed
gestureCompleteResponseActionFires when a gesture was completed
processCompletestringFires when all gestures was completed and return an image in base64 of the captured face
onerrorResponseErrorIs called when an error happens
0.0.53

4 years ago

0.0.52

4 years ago

0.0.50

4 years ago

0.0.48

4 years ago

0.0.49

4 years ago

0.0.47

4 years ago

0.0.45

4 years ago

0.0.46

4 years ago

0.0.42

4 years ago

0.0.43

4 years ago

0.0.44

4 years ago

0.0.41

4 years ago

0.0.40

4 years ago

0.0.39

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.34

4 years ago

0.0.33

4 years ago

0.0.32

4 years ago

0.0.31

4 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.27

4 years ago

0.0.26

4 years ago

0.0.25

4 years ago

0.0.24

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago