# react-ml-kit

> React AI Hooks is a collection of React hooks that allow you to easily integrate AI functionalities using machine learning models directly in the browser. These hooks are designed to be user-friendly and efficient, providing developers with an easy way to

Latest version **1.1.2** (published 2023-03-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-ml-kit
pnpm add react-ml-kit
yarn add react-ml-kit
bun add react-ml-kit
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2023-03-20 |
| First published | 2023-03-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 17 |
| Unpacked size | 93.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Trust Guard |
| Maintainers | jaafarskafi1 |

## Links

- npm: https://www.npmjs.com/package/react-ml-kit
- Repository: https://github.com/Trust-Guard/react-ml-kit
- Homepage: https://github.com/Trust-Guard/react-ml-kit#readme
- Issues: https://github.com/Trust-Guard/react-ml-kit/issues
- npm.io page: https://npm.io/package/react-ml-kit

## Dependencies (17)

- [react](https://npm.io/package/react.md) ^18.2.0
- [upscaler](https://npm.io/package/upscaler.md) ^1.0.0-beta.16
- [typescript](https://npm.io/package/typescript.md) ^4.9.5
- [@types/jest](https://npm.io/package/@types/jest.md) ^29.4.0
- [@types/node](https://npm.io/package/@types/node.md) ^18.11.18
- [@tensorflow/tfjs](https://npm.io/package/@tensorflow/tfjs.md) ^4.2.0
- [@upscalerjs/esrgan-slim](https://npm.io/package/@upscalerjs/esrgan-slim.md) ^1.0.0-beta.8
- [@upscalerjs/esrgan-thick](https://npm.io/package/@upscalerjs/esrgan-thick.md) ^1.0.0-beta.11
- [@mediapipe/face_detection](https://npm.io/package/@mediapipe/face_detection.md) ^0.4.1646425229
- [@upscalerjs/default-model](https://npm.io/package/@upscalerjs/default-model.md) ^1.0.0-beta.14
- [@upscalerjs/esrgan-legacy](https://npm.io/package/@upscalerjs/esrgan-legacy.md) ^1.0.0-beta.10
- [@upscalerjs/esrgan-medium](https://npm.io/package/@upscalerjs/esrgan-medium.md) ^1.0.0-beta.9
- [@tensorflow-models/coco-ssd](https://npm.io/package/@tensorflow-models/coco-ssd.md) ^2.2.2
- [@tensorflow-models/mobilenet](https://npm.io/package/@tensorflow-models/mobilenet.md) ^2.1.0
- [@tensorflow/tfjs-backend-webgl](https://npm.io/package/@tensorflow/tfjs-backend-webgl.md) ^4.2.0
- [@tensorflow/tfjs-backend-webgpu](https://npm.io/package/@tensorflow/tfjs-backend-webgpu.md) ^0.0.1-alpha.17
- [@tensorflow-models/face-detection](https://npm.io/package/@tensorflow-models/face-detection.md) ^1.0.1

## Recent versions

- 1.1.2 (latest) — 2023-03-20
- 1.0.7 — 2023-03-10
- 1.0.6 — 2023-03-10
- 1.0.5 — 2023-03-10
- 1.0.4 — 2023-03-10
- 1.0.3 — 2023-03-10
- 1.0.1 — 2023-03-08
- 1.0.0 — 2023-03-08

## README

# React AI Hooks

React AI Hooks is a collection of React hooks that allow you to easily integrate AI functionalities using machine learning models directly in the browser. These hooks are designed to be user-friendly and efficient, providing developers with an easy way to add AI capabilities to their applications without extensive knowledge in machine learning.

## Installation

bashCopy code

`npm install react-ai-hooks`

## Hooks

### useImageClassifier

This hook is used for classifying images using pre-trained models. It currently supports TensorFlow.js models MobileNet and COCO-SSD.

javascriptCopy code

`import  { useImageClassifier }  from  "react-ai-hooks";`

#### Usage

javascriptCopy code

`const  { loading, data } =  useImageClassifier({ onPredictions, images,  model:  "mobilenet"|  "coco-ssd", });`

### useFaceDetection

This hook is used for detecting faces in a video stream. It utilizes the MediaPipe Face Detection model from TensorFlow.js.

javascriptCopy code

`import  { useFaceDetection }  from  "react-ai-hooks";`

#### Usage

javascriptCopy code

`const  faces =  useFaceDetection(videoRef, options);`

## Use Cases

1.  Object recognition in images: Easily identify objects within images and provide relevant information or actions based on the detected objects.
2.  Face detection and tracking in video streams: Implement real-time face tracking for video chat applications, AR filters, or facial expression analysis.
3.  Image classification for content moderation: Automatically filter out inappropriate images in user-generated content.
4.  Accessibility: Describe images for visually impaired users by identifying objects and their positions within the images.
5.  AI-based search: Enhance search functionality within an application by allowing users to search for specific objects or features within images.

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