0.0.6 • Published 2 months ago

retinaface v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Retinaface-JS npm GitHub

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

Screenshots

screenshot

Usage

Installation

npm install retinaface onnxruntime-web

Example

import * as ort from 'onnxruntime-web'
import Retinaface from 'retinaface'

import modelPath from 'retinaface/mnet.25_v2.onnx?url'
import imagePath from './R.jpg'

ort.env.wasm.wasmPaths = 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/'

const retinaface = new Retinaface(await ort.InferenceSession.create(modelPath), ort.Tensor)

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 = await retinaface.detect(data, scale)

console.log(result)

Author

Shirasawa

License

MIT

0.0.5

2 months ago

0.0.6

2 months ago

0.0.4

2 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago

0.0.0

3 months ago