# ai-face-detection

> This is simple face detection using face-api.js and tensorflow.js

Latest version **1.0.10** (published 2023-02-18) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install ai-face-detection
pnpm add ai-face-detection
yarn add ai-face-detection
bun add ai-face-detection
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2023-02-18 |
| First published | 2023-02-18 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 14.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | alexsanteeno@gmail.com |
| Maintainers | alexsanteeno |
| Keywords | face detection, computer vision, facial recognition, machine learning, deep learning, artificial intelligence, image analysis, face identification, face tracking, emotion detection, face features, age and gender estimation, real-time detection, webcam, video, image processing, JavaScript, TypeScript |

## Links

- npm: https://www.npmjs.com/package/ai-face-detection
- Repository: https://github.com/alexsanteenodev/ai-face-detection
- Homepage: https://github.com/alexsanteenodev/ai-face-detection#readme
- Issues: https://github.com/alexsanteenodev/ai-face-detection/issues
- npm.io page: https://npm.io/package/ai-face-detection

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^1.3.3
- [canvas](https://npm.io/package/canvas.md) ^2.11.0
- [winston](https://npm.io/package/winston.md) ^3.8.2
- [@vladmandic/face-api](https://npm.io/package/@vladmandic/face-api.md) ^1.7.9
- [@tensorflow/tfjs-node](https://npm.io/package/@tensorflow/tfjs-node.md) ^4.2.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2023-02-18
- 1.0.9 — 2023-02-18
- 1.0.8 — 2023-02-18
- 1.0.7 — 2023-02-18
- 1.0.6 — 2023-02-18
- 1.0.5 — 2023-02-18
- 1.0.4 — 2023-02-18
- 1.0.3 — 2023-02-18
- 1.0.2 — 2023-02-18
- 1.0.1 — 2023-02-18

## README

## Face detection
This is simple face detection using face-api.js and tensorflow.js

## Getting Started
```
npm install
```
## Usage

```
import { detectFaces } from 'ai-face-detection'

// using remote image
const imageFromUrl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Elon_Musk_Royal_Society.jpg/640px-Elon_Musk_Royal_Society.jpg'

// using local image
const imageFromFile = './face/face1.jpeg'

faceDetect(imageFromUrl)
  .then((result) => {
        console.log(
        `Face detected gender: ${result?.gender} with probability ${result?.genderProbability}`
        )
        console.log(`Face detected age: ${result?.age}`)
        console.log(`Face detected expressions:`)
        console.log(result?.expressions.asSortedArray())
  })
  .catch((err) => {
    // console.log('err, ', err)
    logger.error('err, ', err)
  })

  ```

## License

The MIT License (MIT). Please see [License File](https://github.com/alexsanteenodev/ai-face-detection/LICENSE) for more information.

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