Socket
Socket
Sign inDemoInstall

ngx-scanner-face-mesh

Package Overview
Dependencies
5
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngx-scanner-face-mesh

This library is built to provide a solution for detecting and marking human faces.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ngx-scanner-face-mesh

This library is built to provide a solution for detecting and marking human faces.
This library analyzes each face and provides statistics for Angular web applications easily.
Demo on the stackblitz or github.

Logo

Installation

Install ngx-scanner-face-mesh from npm:

npm install ngx-scanner-face-mesh --save

Add wanted package to NgModule imports:

import { NgxScannerFaceMeshModule } from 'ngx-scanner-face-mesh';
@NgModule({
    imports: [
        NgxScannerFaceMeshModule,
    ]
})

In the Component:

<ngx-scanner-face-mesh #action="scanner" [isAuto]="true"></ngx-scanner-face-mesh>

<span>{{ action.data.value | json }}</span> <!-- value -->
<span>{{ action.data | async | json }}</span> <!-- async -->
For select files :syringe:
public faceResult: ScannerFaceResult[] = [];

constructor(private face: NgxScannerFaceMeshService) {}

public onSelects(files: any) {
    this.face.loadFiles(files, this.config).subscribe((res: any) => this.faceResult = res);
}
<input #file type="file" (change)="onSelects(file.files)" [accept]="'.jpg, .png, .gif, .jpeg'"/>

<div *ngFor="let item of faceResult">
    <img [src]="item.url || '' | safe: 'url'" [alt]="item.name"> <!-- Need bypassSecurityTrustUrl -->
</div>

API Documentation

Input :hammer_and_wrench:
FieldDescriptionTypeDefault
[isAuto]auto loadbooleanfalse
[src]image urlstring-
[mesh]optionsOptions-
[config]config allScannerFaceConfig-
[style]style for canvasHtmlStyles{width:'100%',height:'100%',background:''#000000''}
[frame]style for canvasCanvasRenderingContext2D{color:'#0BF6F4',lineWidth:.5}
[medias]media configMediaStreamConstraints{audio:false,video:{width:{ideal:1280},height:{ideal:720},facingMode:'environment'}}
Ouput :hammer_and_wrench:
FieldDescriptionTypeDefault
(event)dataany-
(error)errorany-
Component export :hammer_and_wrench:
FieldDescriptionTypeDefault
isLoadingstatusbooleanfalse
isStartstatusbooleanfalse
isPausestatusbooleanfalse
datadataBehaviorSubjectnull
------------
(start)start cameraAsyncSubject-
(stop)stop cameraAsyncSubject-
(download)download with file nameAsyncSubject-
Models
ScannerFaceConfig
interface ScannerFaceConfig {
  src?: string;
  isAuto?: boolean;
  isLoading?: boolean;
  mesh?: Options;
  frame?: HtmlStyles;
  style?: HtmlStyles;
  medias?: MediaStreamConstraints;
}
ScannerFaceResult
interface ScannerFaceResult {
  canvas?: HTMLCanvasElement;
  file?: File;
  name?: string;
  url?: string;
  blob?: any;
  base64?: string;
  result?: Results;
}
HtmlStyles
interface HtmlStyles {
  [key: string]: any;
}
Support versions
Support versions
Angular 141.0.8
Angular 61.0.7
Author Information
Author Information
AuthorDaiDH
Phone+84845882882

Vietnam

MIT License. Copyright (c) 2021 DaiDH

Keywords

FAQs

Last updated on 25 Dec 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc