Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

retinaface-wasm

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retinaface-wasm

Running the Retinaface face recognition algorithm in browser or wechat mini program.

  • 0.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-95.03%
Maintainers
0
Weekly downloads
 
Created
Source

Retinaface-WASM npm GitHub

This is a WASM implementation of the Retinaface face detection algorithm. It is based on the Retinaface paper.

本模块支持微信小程序且不依赖任何第三方库, 可直接使用! (手动 brotli 压缩 wasm 文件和拷贝 index.ts 代码即可)

Screenshots

screenshot

Usage

Installation

npm install retinaface-wasm

Example

import Retinaface, { getWasmFile, env } from 'retinaface-wasm'
import imagePath from './R.jpg'

const wasm = await WebAssembly.instantiateStreaming(fetch('https://cdn.jsdelivr.net/npm/retinaface-wasm/wasm/' + getWasmFile()), env)
const retinaface = new Retinaface(wasm.instance)

const image = new Image()
image.src = imagePath
await new Promise((resolve, reject) => {
  image.onload = resolve
  image.onerror = reject
})

const [data, scale] = retinaface.processImage(image)
const result = retinaface.detect(data, scale)

console.log(result)

retinaface.close()

Brotli Compress WASM

node -e "fs.writeFileSync('retinaface-basic.wasm.br', zlib.brotliCompressSync(fs.readFileSync('retinaface-basic.wasm')))"

Examples

WeChat Mini Program

WeChat Mini Program Example

478 Landmarks

478 Landmarks Example

Landmark Indexes

landmarks

Author

Shirasawa

License

MIT

Keywords

FAQs

Package last updated on 13 Nov 2024

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc