fvi-node-face-api-rtsp-stream

0.0.3 • Public • Published

Requirements

About

The Node Face API RTSP Stream library uses face-api.js and node-rtsp-stream to consumes data messages from RTSP Stream and detect faces on it.

How to Use

mkdir test-face-detect
cd test-face-detect
npm init -y
npm install --save fvi-node-face-api-rtsp-stream

Dev

git clone https://github.com/salespaulo/fvi-node-face-api-rtsp-stream
cd fvi-node-face-api-rtsp-stream
npm install
npm run dev
# OR 
npm run test

Instantiate

const FaceApiRtspStream = require('fvi-node-face-api-rtsp-stream')
 
const instance = FaceApiRtspStream({
    name: 'ID',
    url: 'rtsp://',
    port: 6789,
    score: 0.5,
    stream: 'new node-rtsp-stream/videoStream()',
})

Starting/Stoping

instance
    .start()
    .then(res => console.log('Initializate'))
    .catch(e => console.error(e))
 
instance.stop()

Events

instance.on('error', e => console.error(e))
instance.on('warn', message => console.log(message))
instance.on('data', event => console.log(event))
instance.on('detect', event => console.log(event))
instance.on('start', event => console.log(event))
instance.on('stop', event => console.log(event))

Lab

Into directory lab you find tests with this library using WebSocket and jsmpeg.js. Let's join it!

  • index.js: Starts fvi-node-face-api-rtsp-stream, collects face detects, draw details and send, WebSocket.socket.send, buffered image to ws-index.html.

  • ws-index.html: Connects via WebSocket, get buffered images with detections and show.

  • jmpeg-index.html: Connects via jsmpeg.js, nd show.

Run

npm i
cd lab
node ws-index.test.js

After this, opens browser url http://localhost:8081 to see images.

Licence

MIT

Package Sidebar

Install

npm i fvi-node-face-api-rtsp-stream

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

174 kB

Total Files

18

Last publish

Collaborators

  • salespaulo