# retinaface

> Running the Retinaface face recognition algorithm in browser.

Latest version **0.0.6** (published 2024-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install retinaface
pnpm add retinaface
yarn add retinaface
bun add retinaface
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2024-03-09 |
| First published | 2024-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Shirasawa |
| Maintainers | ncbql |
| Keywords | retinaface, face-detection, face-recognition, face-detect, face-detector, wasm, onnx, onnxruntime, webgl, ai |

## Links

- npm: https://www.npmjs.com/package/retinaface
- Repository: https://github.com/ShirasawaSama/retinaface-js
- Homepage: https://github.com/ShirasawaSama/retinaface-js#readme
- Issues: https://github.com/ShirasawaSama/retinaface-js/issues
- npm.io page: https://npm.io/package/retinaface

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2024-03-09
- 0.0.5 — 2024-03-09
- 0.0.4 — 2024-03-08
- 0.0.3 — 2024-03-07
- 0.0.2 — 2024-03-04
- 0.0.1 — 2024-03-04
- 0.0.0 — 2024-03-03

## README

# Retinaface-JS [![npm](https://img.shields.io/npm/v/retinaface)](https://www.npmjs.com/package/retinaface) [![GitHub](https://img.shields.io/github/license/ShirasawaSama/retinaface-js)](LICENSE)

This is a JavaScript implementation of the Retinaface face detection algorithm. It is based on the [Retinaface](https://arxiv.org/abs/1905.00641) paper.

## Screenshots

![screenshot](screenshots/retinaface.jpg)

## Usage

### Installation

```bash
npm install retinaface onnxruntime-web
```

### Example

```typescript
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](LICENSE)

---
_Source: https://npm.io/package/retinaface · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
