Face and person detection with Deepstack - local and free!

I have the same setup, Win 10 pc running Blue Iris, HA is running on a different PC.
I installed docker on the Win 10 pc with Blue Iris and installed DeepStack in the docker container.

I just followed the general instructions from github https://github.com/robmarkcole/HASS-Deepstack-object and it seems to be working fine.

1 Like

I run hassos in a vm on esxi
 4gb ram. Can I best spin up another vm? How to install there?

I have a question regarding ‘confidence’ , ‘states’ and ‘attributes’ if someone can help me understand please


There’s nothing on the drive and nobody in the garden - so that’s right (or should it be ‘0’ in states with empty attributes??). There’s two cars out front so that’s right. In the living room there are 2 people, sooooo


Why is the state ‘0’ for living room when person is one of my tracked thingy’s for the living room?

If it’s because the confidence is under 80% then why is it appearing as an attribute? Surely it should be one or the other?

Is there any way to see what the confidence level was for detected objects, that didn’t make the grade?

Thanks in advance.

@jan.lanner can you share your flow.
I am not sure what to put in the DeepStack People Result.

@anon43302295 the confidence info you want is in the deepstack.object_detected event payload

@b.maia81 I understand that on windows (and mac) docker is running in a VM (virtualbox) already

1 Like

Some help appreciated


no errors in log

configuration.yaml
image

Camera works fine in home assistant (camera.yaml):

deepstack vm with 8GB RAM running:

But I get:
image

What is missing/wrong?

Have you called the image_processing.scan service?

Ehm
 dont know what or how to do that
?

I have made some changes since my last post, but here is my flow.


[
    {
        "id": "364678b5.984258",
        "type": "function",
        "z": "9d603216.7eee9",
        "name": "Create message PushOver",
        "func": "var date = new Date();\nvar fDate = date.toString();\nfDate = fDate.replace(\"GMT+0200\", \"\");\nfDate = fDate.replace(/\\(|\\)/g, \"\");\nfDate = fDate.replace(\"Central European Summer Time\", \"\");\nvar lastActiveCamera = flow.get('lastActiveCamera') || \"binary_sensor.frontdoor_camera_motion\" ;\n\n//msg.payload = \"Sensor: \" + msg.data.attributes.friendly_name + \"\\nTime: \" + fDate;\nif (lastActiveCamera == \"binary_sensor.frontdoor_camera_motion\")  \n{\n    msg.payload = \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;msg.payload = \"Sensor: \" + \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;\n    msg.topic = \"Se upp!! NÄgon Àr pÄ framsidan\"\n}\nelse if (lastActiveCamera == \"binary_sensor.patio_camera_motion\" )\n{\n    msg.payload = \"Rörelsesensor baksidan\" + \"\\nTime: \" + fDate;\n    msg.topic = \"Se upp!! NÄgon Àr pÄ baksidan\"\n}\nelse if (lastActiveCamera == \"binary_sensor.back_camera_motion\" )\n{\n    msg.payload = \"Rörelsesensor baksidan\" + \"\\nTime: \" + fDate;\n    msg.topic = \"Se upp!! NÄgon Àr pÄ baksidan\"\n}\n//msg.payload = \"Sensor: \" + \"Rörelse sensor framsida\" + \"\\nTime: \" + fDate;\nmsg.attachment = \"/config/node-red/data/img/deepstack_latest_person.jpg\";\nmsg.sound = \"spacealarm\"\n//msg.topic = \"Se upp!! NÄgon Àr pÄ framsidan\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1300,
        "y": 1400,
        "wires": [
            [
                "774e49.793b11b8"
            ]
        ]
    },
    {
        "id": "2c729bcd.3cb854",
        "type": "api-current-state",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Result",
        "server": "bac22f38.4b474",
        "version": 1,
        "outputs": 2,
        "halt_if": "1",
        "halt_if_type": "num",
        "halt_if_compare": "gte",
        "override_topic": false,
        "entity_id": "image_processing.person_detector_back",
        "state_type": "str",
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 930,
        "y": 1520,
        "wires": [
            [
                "364678b5.984258"
            ],
            []
        ]
    },
    {
        "id": "97b2e023.14716",
        "type": "api-current-state",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Result",
        "server": "bac22f38.4b474",
        "version": 1,
        "outputs": 2,
        "halt_if": "1",
        "halt_if_type": "num",
        "halt_if_compare": "gte",
        "override_topic": false,
        "entity_id": "image_processing.person_detector_patio",
        "state_type": "str",
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 930,
        "y": 1440,
        "wires": [
            [
                "364678b5.984258",
                "f25b6dd.58ed49"
            ],
            []
        ]
    },
    {
        "id": "6125bbd5.c38ac4",
        "type": "api-current-state",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Result",
        "server": "bac22f38.4b474",
        "version": 1,
        "outputs": 2,
        "halt_if": "1",
        "halt_if_type": "num",
        "halt_if_compare": "gte",
        "override_topic": false,
        "entity_id": "image_processing.person_detector_frontdoor",
        "state_type": "str",
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 930,
        "y": 1380,
        "wires": [
            [
                "364678b5.984258",
                "f25b6dd.58ed49"
            ],
            []
        ]
    },
    {
        "id": "ba992093.a6b92",
        "type": "api-call-service",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Scan",
        "server": "bac22f38.4b474",
        "version": 1,
        "debugenabled": false,
        "service_domain": "image_processing",
        "service": "scan",
        "entityId": "image_processing.person_detector_back",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 650,
        "y": 1520,
        "wires": [
            [
                "2c729bcd.3cb854"
            ]
        ]
    },
    {
        "id": "e7c10aa0.0515b8",
        "type": "api-call-service",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Scan",
        "server": "bac22f38.4b474",
        "version": 1,
        "service_domain": "image_processing",
        "service": "scan",
        "entityId": "image_processing.person_detector_patio",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 650,
        "y": 1440,
        "wires": [
            [
                "97b2e023.14716"
            ]
        ]
    },
    {
        "id": "c9128e2f.51e1c",
        "type": "api-call-service",
        "z": "9d603216.7eee9",
        "name": "DeepStack People Scan",
        "server": "bac22f38.4b474",
        "version": 1,
        "service_domain": "image_processing",
        "service": "scan",
        "entityId": "image_processing.person_detector_frontdoor",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 650,
        "y": 1380,
        "wires": [
            [
                "6125bbd5.c38ac4"
            ]
        ]
    },
    {
        "id": "70df4b2a.700bb4",
        "type": "change",
        "z": "9d603216.7eee9",
        "name": "Set Entity_id AND flow.Variable",
        "rules": [
            {
                "t": "set",
                "p": "entity_id",
                "pt": "msg",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "lastActiveCamera",
                "pt": "flow",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "msg_payload",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 1520,
        "wires": [
            [
                "ba992093.a6b92"
            ]
        ]
    },
    {
        "id": "ef058ff5.58dd7",
        "type": "change",
        "z": "9d603216.7eee9",
        "name": "Set Entity_id AND flow.Variable",
        "rules": [
            {
                "t": "set",
                "p": "entity_id",
                "pt": "msg",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "lastActiveCamera",
                "pt": "flow",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "msg_payload",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 1440,
        "wires": [
            [
                "e7c10aa0.0515b8"
            ]
        ]
    },
    {
        "id": "18127063.6ce1f",
        "type": "change",
        "z": "9d603216.7eee9",
        "name": "Set Entity_id AND flow.Variable",
        "rules": [
            {
                "t": "set",
                "p": "entity_id",
                "pt": "msg",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "lastActiveCamera",
                "pt": "flow",
                "to": "data.entity_id",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "msg_payload",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 1380,
        "wires": [
            [
                "c9128e2f.51e1c"
            ]
        ]
    },
    {
        "id": "83f6bb11.513ca8",
        "type": "server-state-changed",
        "z": "9d603216.7eee9",
        "name": "Back Motion",
        "server": "bac22f38.4b474",
        "version": 1,
        "entityidfilter": "binary_sensor.back_camera_motion",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "x": 90,
        "y": 1520,
        "wires": [
            [
                "70df4b2a.700bb4"
            ],
            []
        ]
    },
    {
        "id": "5ef20b03.e9bf44",
        "type": "server-state-changed",
        "z": "9d603216.7eee9",
        "name": "Patio Motion",
        "server": "bac22f38.4b474",
        "version": 1,
        "entityidfilter": "binary_sensor.patio_camera_motion",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "x": 90,
        "y": 1440,
        "wires": [
            [
                "ef058ff5.58dd7"
            ],
            []
        ]
    },
    {
        "id": "77a215e7.10463c",
        "type": "server-state-changed",
        "z": "9d603216.7eee9",
        "name": "Front Door Motion",
        "server": "bac22f38.4b474",
        "version": 1,
        "entityidfilter": "binary_sensor.frontdoor_camera_motion",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "x": 110,
        "y": 1380,
        "wires": [
            [
                "18127063.6ce1f"
            ],
            []
        ]
    },
    {
        "id": "bac22f38.4b474",
        "type": "server",
        "z": "",
        "name": "Home Assistant 101",
        "legacy": false,
        "hassio": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true
    }
]

Well, I will give it a try.
is this what I need to install first? https://docs.docker.com/docker-for-windows/install/

Yes, that is what I used.

Can you pleas help me on the way?

What are you using to trigger the scan? How does the system know when to search for the person/face?
You need an automation of some sort that will trigger the image_processing.scan service

Ehm
I think not
 I thought that if I put the camera entirty id in the confguration it would constantly scan for people? But based on your answer this is not the case.

How can I manual trigger such a scan based on my config above? I think I can then proceed myself with the automation


Manually?
Not sure what you are using for a camera but I am guessing most (myself included) have it trigger when the camera detects motion.
You could add a picture glance card and change the Tap action to call-service and set the Service to image_processing.scan and set the Service Data to your entity like entity_id: image_processing.deepstack_frontdoor

I have tried to make a picture glance card
 bu no snapshot appearing in /config/snapshots and seeing nothing happen


image

Well I’m stuck and didn’t reach the HA part.
So I installed docker and deepquest. Activated it. And I assume it is running.
Is there something I can do in docker to see it is running?
In Blue Iris I’ve created a folder that will have the images that camera will trigger.
From reading this thread I see that I have to create the integration within home assistant and create the folder save_file_folder, but this is my PI, and Blueiris is on a PC. How do I send the image to the pi folder? Or is there a way to configure deepstack to analyze directly on my PC folder, and then HA will just send the mesage to iphone?
Thanks!

For some reason, I’m not able to whitelist the snapshots folder.
image

My Yaml
image

Error
image

So I had to leave out the folder.
image

Does anyone knows how to solve this?

add one more spacing to the line - /config

tried but didn’t work.
I copied the code from https://www.home-assistant.io/docs/configuration/basic/
and just changed the directory.
PS: Also tried removing the “default_config:” but that didn’t help. Added some ‘’ to the directy also didn’t work.
It just doens’t accept the directory.
I searched for similar errors and this was a bug in the past but should have been solved meanwhile.