An open API service indexing awesome lists of open source software.

https://github.com/gwendall/use-media-models

A toolset to use media models in React
https://github.com/gwendall/use-media-models

Last synced: about 2 months ago
JSON representation

A toolset to use media models in React

Awesome Lists containing this project

README

        

A toolset to use AI media models in React.

## Install
`yarn add use-media-models` or `npm install use-media-models --save`.

## Use a model

### useMediapipe
```typescript
import React from "react";
import { useCamera, useMediapipe } from "use-media-models";

export default function ExamplePage() {
const videoRef = React.useRef(null);
const { startCamera } = useCamera(videoRef);
const { startModel, } = useMediapipe("faceLandmarker", {
onResults: (results, stream) => {
console.log('Got results.', results.faceLandmarks);
},
});
React.useEffect(() => {
startCamera().then(({ stream }) => startModel({ stream }));
}, []);
return (

);
}
```