You could use classificationbox to determine which car colour is present, but you would still need deepstack object detection to identify the car in the first place.
What about using a license plate recognition API like https://www.openalpr.com/cloud-api.html or https://platerecognizer.com/pricing ?
Havenāt tried it yet myself, but I intend to at some point,
Thats pretty slick! The camera I have doesnāt see the the back of the vehicles unfortunately. Iām going to try the article Robin linked to and see if I canāt train Deepstack to identify each of our cars.
Arrgh Iām getting crazy - I canāt figure out how to get the attribute for matched faces.
- service_template: '{% if (states.image_processing.baghave_stue_objektgenkendelse.state | int) > 0 %} notify.android {% endif %}'
data_template:
message: >
{% if is_state('image_processing.backyard_face.matched_faces', 'Jaycee') %}
Hey, Your GF's lover is at your house!
{% else %}
Who the hell is that!?
{% endif %}
data:
image: 'http://xxx.xxx.xxx.xxx:8123/local/deepstack_person_images/backyard/deepstack_latest_person.jpg'
I tried with various things - but no luck.
What at I doing wrong - I want the first message to be shown if the face is one of the teached ones and if not the other message.
The notification fires correctly and I do get the picture as well, but the text doesnāt match what should be the outcome.
@robmarkcole perhaps you know?
That looks right up my alley. I think Ill give this a shot before I start trying to pull together 200 pictures of each of our cars, ha.
I am running HA in a docker container though - you have any quick links to getting Tensorflow up and running with HA in a docker container? Most of the instructions Iāve found donāt seem to apply to Hassio or docker installs.
You can connect to the container and pip install tensorflow
Another exciting community announcement, you can now run Deepstack on an RPI with hardware acceleration using an Intel Movidius stick! Keep up the great work @OlafenwaMoses
This VS Google Coral in terms of performance?
@Yoinkz check is_state('image_processing.backyard_face.matched_faces', 'Jaycee')
in the template editor, Iām pretty sure this is incorrect.
@calypso I did a quick check, the Coral processed in vision/detect
mode an image in ~ 600 ms whilst the NCS was taking ~ 2.5 s, so considerably longer. However NCS support is still in alpha so I expect this will improve. If you want to read a benchmark on the hardware checkout the article below
@robmarkcole I tried that, and you seem to be right
The output I get is just the same.
is_state('image_processing.backyard_face.matched_faces', 'Jaycee')
So I tried something like this:
'{% if (states.image_processing.backyard.matched_faces), 'Jaycee' %} notify.android {% endif %}'
Which gives me this output: ' notify.android '
Unfortunately it gives me the same result if I remove Jaycee with just ''
(No space in between).
matched_faces
is a dictionary, so you would need to access the key. Really the face integration needs a bit of polishing
The key like the number in the array or {1, 2, 3}?
Iām a bit on deep water here
YIKES Will have to do some Trial and Error I guess
@robmarkcole Sorry for not being that sharp, but I try to read through the documentation - but should I be able to use some of the commands and how to get the ākeysā in the template editor and get the output?
Im having trouble with the GPU version. When running the CPU Home Assistant can communicate with Deepstackā¦ but when using the GPU nothing happens, not even when using scan. Nothing in the logs either.
Here is the config:
image_processing:
- platform: deepstack_face
ip_address: localhost
port: 3451
scan_interval: 200
source:
- entity_id: camera.face
name: face_counter
Here is how I start the container:
sudo docker run --rm --runtime=nvidia -e VISION-FACE=True -v localstorage:/datastore -p 3451:5000 deepquestai/deepstack:gpu
From the terminal after running the start command:
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/10_syslog-ng.init...
Aug 11 10:50:34 9ce038dce004 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
Aug 11 10:50:35 9ce038dce004 syslog-ng[10]: EOF on control channel, closing connection;
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 16
Aug 11 10:50:35 9ce038dce004 cron[23]: (CRON) INFO (pidfile fd = 3)
Aug 11 10:50:35 9ce038dce004 cron[23]: (CRON) INFO (Running @reboot jobs)
DeepStack is Active
Active APIs:
/v1/vision/face
---------------------------------------
/v1/vision/face/recognize
---------------------------------------
/v1/vision/face/register
---------------------------------------
/v1/vision/face/match
---------------------------------------
/v1/vision/face/list
---------------------------------------
/v1/vision/face/delete
---------------------------------------
v1/vision/addmodel
---------------------------------------
v1/vision/listmodels
---------------------------------------
v1/vision/deletemodel
---------------------------------------
v1/vision/setadminkey
---------------------------------------
v1/vision/setapikey
---------------------------------------
v1/vision/backup
---------------------------------------
v1/vision/restore
Tested out the component and docker container, it works flawlessly!
Is it possible to customize the output filename(s)? Moving from Tensorflow with several cameras I have great usage of the file_out-parameter which makes it easy organizing the images. For instance I save the latest image to a different folder.
Example configuration from Tensorflow-component:
file_out:
- "/config/www/tensorflow/{{ camera_entity.split('.')[1] }}_latest.jpg"
- "/config/camera/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}_tensor.jpg"
@myhrmans have you used curl to check the endpoint is functioning correctly? If itās a GPU specific issue the DeepStack forums might be the best place to ask
So I used to have deepstack running without issue. I since had some issue on my unraid box and i had to remove the docker container because of lack of space.
Now i have reinstalled the docker container and deepstack is showing that its Active in the logs. Whenever Im processing an image.processing transaction in home assistant I get a āConnectionError: Is deepstack_object running?ā error.
I can see the call going though to DeepStack ([GIN] 2019/08/11 - 15:42:49 | 200 | 19.768Āµs | 192.168.2.36 | POST /v1/vision/detection) just getting nothing in my person detection in Home Assistant (Unknown). That processing time in the DeepStack logs is also way too fast.
Any ideas what could be the issue? I used the same Deepstack activation key as last time and the instance is showing as active.
Maybe something to do with the HACS version of the Deepstack custom component? Its the only thing different. Now im also seeing this error:
Log Details (ERROR)
Sun Aug 11 2019 20:59:52 GMT+0200 (South Africa Standard Time)
Update for image_processing.person_detection_rear_garden_camera fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 378, in async_device_update
await self.async_update()
File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 132, in async_update
await self.async_process_image(image.content)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/deepstack_object/image_processing.py", line 157, in process_image
predictions_json = response.json()["predictions"]
KeyError: 'predictions'
My target is āpersonā nothing fancy.
I know thge problem is going to be something small and insignificant but I just cant quite place it.