retinaface
v0.0.6
Published
Running the Retinaface face recognition algorithm in browser.
Downloads
18
Maintainers
Readme
Retinaface-JS
This is a JavaScript implementation of the Retinaface face detection algorithm. It is based on the Retinaface paper.
Screenshots
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