meeki007 / node-red-contrib-facial-recognition

Provides a node-red node for Facial Detection & Facial Recognition
Apache License 2.0
8 stars 3 forks source link

Feature request: url or file path as input #21

Closed crxporter closed 3 years ago

crxporter commented 3 years ago

Would it be possible to have the input payload be a file or web path (my security camera images are located on LAN) rather than having to pass a buffer to the node? Loading and sending the buffer takes 2 or 3 times as long as this node does to process faces... If the input payload could just be a path to an image it might speed things up a lot!

Thanks for a cool node!

meeki007 commented 3 years ago

It has to be a buffered image. the API only accepts a buffered image

tf.node.decodeImage(buffer);

and see https://js.tensorflow.org/api/latest/#buffer

I have the user use node red's buffer instead of doing it myself like the example code below.

const buffer = fs.readFileSync(img);

as it gives the user more control to fetch the image from a url or severer and then buffer it using node-red.

I hope this helps with your question

crxporter commented 3 years ago

Cool! Thanks for the extra detail. I'll carry on and try to find the quickest way to pass a buffer into the node.

meeki007 commented 3 years ago

also I'm a month or 2 away from releaseing a way better version of this node based on Human https://github.com/vladmandic/human

this should be way more accurate and a tad faster. see ---> https://github.com/vladmandic/face-api/discussions/26#discussioncomment-229336

I've been just so dang busy chasing the dollar of late to finish off the code

crxporter commented 3 years ago

Cool! I'll definitely be watching.

I only loaded this node the first time a couple hours ago. I can get it to recognize faces on my pi 4 but I wasn't successful in having it recognize who's face it is yet. I loaded a folder full of my face but didn't get anything.

Maybe soon I'll be able to unlock the front door just by standing at the doorbell!

meeki007 commented 3 years ago

so to detect your face load in 5 images of your face into a folder with your name @ location of nodes/node-red-contrib-facial-recognition/example/labeled_face/your_name_here

then it should ID you

crxporter commented 3 years ago

Cool I'll try it tomorrow