1.0.0 • Published 3 years ago

psm-face-captcha v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

PsmFaceCaptcha

This library was generated with Angular CLI version 10.0.14.

This library is for educational purposes and is in development.

Getting started

Instalation

npm i psm-face-captcha

Usage 1

Opens a device's camera, a photo is captured, and returns information that determines whether the photo contains a face. In case of not having a face, a prediction of the element of the captured photo is made.

Import

In the file necessary example.module.ts import the module.

In this case app.module.ts

import { PsmFaceCaptchaModule } from 'psm-face-captcha';
.
.
.
... imports: [
       ...,
       PsmFaceCaptchaModule
    ]...

HTML

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

<lib-psm-face-captcha
  [companySrc]="companySrc"
  (onloader)="onloader($event)"
  (ondata)="ondata($event)"
  (onerror)="onerror($event)">
</lib-psm-face-captcha>

Typescript

Listen to the events and execute methods:

onloader(loader: boolean) {
  // error handling
}

onerror(error: object) {
  // loader handling
}

ondata(data: object) {
  // data handling
}

Inputs

NameTypeRequiredDefaultDescription
companySrcstringtrueundefinedImage of company to paint in screen
backgroundIconstringfalse"white"Camera buttons background color
switchCamerabooleanfalsetrueswitch between front camera and rear camera

Outputs

NameReturnDescription
ondataobjectIs called after the user captured the photo
onloaderbooleanIs called when the process is asynchronous
onerrorobjectIs called when an error happens