Face detection with Docker/Machinebox

Did you change IP address - it is here listed as “PRIVATE” - it should be your domain/IP address?

I can’t actually import your flow. I’m getting this error:

SyntaxError: Unexpected token “ in JSON at position 2

Can’t access node-red from here, will try exporting it again and saving as text once more.

Thank you. Appreciate it.

This shoul be it. Formated. You can put it in .json and import

[
{
“id”: “6031b9f1.decbb8”,
“type”: “http in”,
“z”: “3a3710e2.b0ec4”,
“name”: “”,
“url”: “/synology_flows/:webhook”,
“method”: “get”,
“upload”: false,
“swaggerDoc”: “”,
“x”: 176.5,
“y”: 119.99999904632568,
“wires”: [
[
“11e82352.ac456d”
]
]
},
{
“id”: “89f6a2be.82e43”,
“type”: “http request”,
“z”: “3a3710e2.b0ec4”,
“name”: “”,
“method”: “use”,
“ret”: “txt”,
“paytoqs”: false,
“url”: “https://127.0.0.1:8123/api/webhook/{{req.params.webhook}}”,
“tls”: “b6c11d45.7c62c”,
“proxy”: “”,
“x”: 608.500072479248,
“y”: 408.99999713897705,
“wires”: [
[
“30c1cbb2.dc86a4”
]
]
},
{
“id”: “30c1cbb2.dc86a4”,
“type”: “http response”,
“z”: “3a3710e2.b0ec4”,
“name”: “”,
“statusCode”: “”,
“headers”: {},
“x”: 830.5000419616699,
“y”: 539.0000066757202,
“wires”:
},
{
“id”: “11e82352.ac456d”,
“type”: “function”,
“z”: “3a3710e2.b0ec4”,
“name”: “”,
“func”: “msg.payload = {};\nmsg.payload = "{}";\nmsg.headers = {};\nmsg.headers[‘Content-Type’] = ‘application/json’;\nmsg.method = "POST"\n\nreturn msg;”,
“outputs”: 1,
“noerr”: 0,
“x”: 409.5000190734863,
“y”: 242.99999904632568,
“wires”: [
[
“89f6a2be.82e43”
]
]
},
{
“id”: “b6c11d45.7c62c”,
“type”: “tls-config”,
“z”: “”,
“name”: “”,
“cert”: “”,
“key”: “”,
“ca”: “”,
“certname”: “”,
“keyname”: “”,
“caname”: “”,
“servername”: “”,
“verifyservercert”: true
}
]

Hey Everyone. So I have attempted to setup facebox. It looks like for whatever reason I am missing some of the endpoints such as /facebox/teach and /facebox/check both of those pages gives me a 404 page not found. I have reached out to facebox as well but I’m not sure if I’ll get a response. Does anyone know where I can find a detailed logs for facebox? When I look at the /heatlhz it looks like everything is good to go without any errors.

Hmm - I belive you are doing it wrong. Those URLs are for POST I think:

Use the /facebox/teach endpoint to teach Facebox a face:

POST /facebox/teach
  • name - (required string) The name of the person (ensure this value is exactly the same for multiple examples from the same person)
  • id - (optional string) Unique ID for each teaching example (typically use the filename)

The face may be provided by submitting an image file, or by specifying the Faceprint.

  • The image you use to teach Facebox must contain only a single detectable face, an error will be returned if Facebox cannot detect a face, or if it detects multiple faces
  • Facebox supports one-shot teaching, but providing more examples of each person will improve its accuracy

If you open default URL (I think it’s port 8080), just below that text you will see “By URL” “By Post” & “By Face print”

There you can use By post to submit images to teach it.
Also someone has made script for teaching it with multiple images (in same folder).

And REMEMBER! free version doesn’t save face print, just keeps it in memory.
So if you want to have it availabe after restart save face print to local/network disk and reload it after restart (again, someone made a script).

Hi!
I’ve a second HassOS working on a 4 GB Ram Virtual Machine for testing purposes.
It’s a fresh install and only has the Portainer add-on.
I’m trying to deploy machinebox, but I don’t know how inside Portainer, since It’s not in the App list, and neither do find the CLI for writing the commands mentioned in the documentation.
Some guidance would be highly appreciated!

AFAIK Machinebox products are not supported on HassOS. You coul dtry the OpenCV or Tensorflow integrations for face detection

Hey man!

Followed your tutorial and ended up with a pretty similar setup.
But I am not having an issue where the recognized face seems to stay in cache and then gets redetected the next time someone rings.

Did you had a similar issue?

That is most likely an issue with the camera, returning the same image or something

I resolved the issue by bypassing home assistant with the face-recognition.

It now works pretty great.

Instead of running the scan service and watching the current state afterward, I use an HTTP node (in node-red) to post the image of the camera to facebox.

Thanks for the reply tho!

1 Like

Hi guys,
i’ve correctly installed and configured the docker image and facebox is running fine. I’m tryng to get the script for training working but i’m not able to do that. I’ve the script in my hass.io python_scripts folder and there i have 2 subdir named with people i want to identify. Inside that folders i have a couple.of images to train, but if i run the script, nothing happens, no face identified (checked in the frontend of the facebox instance). What i’m doing wrong?

Hi, currently I’m running Deepstack face/object in Docker on an Intel NUC and all works fine. I’m eager to try Facebox too for the sake of comparing. The problem is when I try to register to Veritone to get the key I get a “bad request” error without further explanation. Anyone faced the same problem?
Thank you in advance

@fergalom - how did you go with your door bird images and faces being recognised? I think I have setup everything correctly - Facebox running properly on docker, an automation the same as yours creating a snapshot and then using that snapshot as the local_file camera. Scan interval at 10000 and triggering the scan within the automation.

But no matter what I do, I can not get face detection working with the snapshot from the Doorbird. If I find a photo of myself and save it over the snapshot file it works perfectly, but the doorbird image just will not work?! All I can think of is the quality of the image isn’t good enough? The camera is in a shady area so maybe that is the problem. You can clearly make out my face but it just ignores the files coming from the snapshot…

@robmarkcole - how good is the facial scanning? If it generating an image where I can see my face, would it normally detect it ok? Or am I expecting it to be more powerful than it is - do the images need to be perfect to work?

The only thing I can think of is that the file generated from the doorbird snapshot is different somehow (it’s a jpg but maybe something different about it)? Hence why I was interested whether Fergalom had succeeded with his doorbird installation.

Thanks all.

Locky

Have you checked by “hand” images that are saved for local_file use? While testing I’ve setup everything and then also copied all temporary/triggered images to second location. Those images I’ve use to test Facebox by hand also one by one.

If this works, then something is wrong in the way you trigger image processing of local_file. Maybe it’s to fast and image stil isn’t saved when you try to process it.

It can help if you put various trigger notifications for your somewhere - for ex. if you use Telegram add extra action that would send you notification in each of the phases: camera trigger, file saving, trigger image verification, image processing,…

Also, just FYI - status of the Facebox detection is 99% of the time unavailable - only the moment it recognises state/person it briefly triggers that person.

image

Each color is different person

Hi @BeardedConti - thanks for your help. Yes I have been doing every different element by “hand” and still get no love. I manually trigger the snapshot to create the image. I check the local_file image and it is there and updated. I then run the scan manually as a service and it just ignores it. If I drop a different (albeit better quality) image over the top of the snapshot file then run the scan, it picks up with 100% accuracy. So I know all my config is ok (as it picks up the facial recognition with the different image) and I leave plenty of time in between each step I take manually.

I have tried getting the image generated by the doorbird and adding it to the teaching images (through the Python script), but it says it cannot find a face.

How well does Facebox work with poor image quality? Does it require something in HD? Theoretically the Doorbird is 720p although it suffers a bit in low light.

I’m running it with 1080p cameras. But in dark images are grainy. Doesn’t work perfectly in terms of image quality and results in night are not very good.

As for Facebox, haven’t seen any image requirements or recommendations, but my guess - better image, more success.

BTW - how did you teach machine? You should use same camera for teaching faces as you use for monitoring.

@lockytaylor a clear face shot is required. Grainy small faces on a CCTV might not cut it. I see face recognition being used to things like door interlocks, where a person ‘poses’ for the capture. I use deepstack now rather than facebox

Thanks guys - I have to admit I wasn’t using the same camera for the teaching, I was using holiday snaps… I will try just using cameras from that camera and see what happens.

How does Deepstack compare when it comes to the quality of the shot needed? I am running a Qnap with a J1900 and 8GB of RAM. Does it work out of a docker the same?