Please help with dlib configuration

Ive been fighting with this for awhile now and have searched all over, seems like no one really ran into this issue but me lol. Im trying to setup dlib on my ubuntu vm. The face detect works good, but the identify portion…the logs tell me its looks for a file but its not there. But it is there, Ive tried renaming the photo, using differnent photots, using differnet paths…permissions are right… Please let me know if you spot something im doing wrong.

image_processing:
  - platform: dlib_face_detect
    source:
      - entity_id: camera.front_yard
        name: Jack

  - platform: dlib_face_identify
    source:
      - entity_id: camera.front_yard
    faces:
      Jack: /usr/share/hassio/homeassistant/www/d.jpg

(Ive also tried ‘/local/d.jpg’ and ‘/config/d.jpg’)

Logs:
ERROR (MainThread) [homeassistant.config] Invalid config for [image_processing.dlib_face_identify]: not a file for dictionary value @ data['faces']['Jack']. Got '/usr/share/hassio/homeassistant/www/d.jpg'

I think you will need name: Jack under dlib_face_identity so…

  - platform: dlib_face_identify
    source:
      - entity_id: camera.front_yard
        name: Jack
    faces:
      Jack: /usr/share/hassio/homeassistant/www/d.jpg

See if that makes any difference?

Thanks Keith, I tried your suggestion however I am still getting the error. I tried all the different paths as well, do you have this working? Would you mind sharing your config if so?

THanks again

image_processing:
  - platform: dlib_face_detect
    source:
      - entity_id: camera.eye_3
  - platform: dlib_face_identify
    source:
      - entity_id: camera.eye_3
        name: Jack
    faces:
       Jack: d.jpg

2018-09-16 14:34:23 ERROR (MainThread) [homeassistant.config] Invalid config for [image_processing.dlib_face_identify]: not a file for dictionary value @ data['faces']['Jack']. Got '/local/d.jpg'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/image_processing.dlib_face_identify/

Your indentation is off.
Try this:

  - platform: dlib_face_detect
    source:
    - entity_id: camera.eye_3
  - platform: dlib_face_identify
    source:
    - entity_id: camera.eye_3
      name: Jack
    faces:
      Jack: d.jpg

Man I really thought that might have been it, i hate how thats formatted compared to most others. However I get the exact same error…

With the face detect component, is there a way to create a camera that would show a box around each face that is detected?

Right now it this is all I get:

In the opencv component, you see at the bottom of the documentation you can add a component that will show you the camera but add a box around detected faces.

Ok, try this:
Put the image file into homeassistant/www/faces (create a folder named faces, or whatever)
Then use this path in the yaml file:

/home/homeassistant/.homeassistant/www/faces/d.jpg

Also, to answer your question about that thing showing what dlib sees… I think there is nothing out there. I couldnt find anything. If you ever find, please let me know, as I am interested too.

Edit: If this doesnt work, this is because it is the wrong path if you are NOT using raspbian. You didnt mention anything about your setup, so I just guessed.

Had the same error, it was something with the resolution and file type, please try uploading another picture and check it.

Once I’ll get back home (next week) I’ll send you exactly the file type and resolution I’m using.

@argykaraz Hey sorry buddy, I didnt get a notice of your reply for some reason so I just seen it. Im positive I have the path correct, Im runnin ha docker on an ubuntu vm. I can access the pics by url…typically I just use /home/homeassistant/.homeassistant/www/example.jpg.

@bar thanks buddy. I will try a couple others.

I tried 3-4 different images and always get the same error, you mind sharing the characteristics of a picture you know its working?

dont know if you are still wondering but I had this same error until I removed the “name:” under source. i never tried to figure out how to get it to work i just left it off.

Can you share your code? I have the same error and tried everything already.
Thanks

Sorry, I am not using dlib anymore. Too heavy for a raspberry…

What are you using now instead?

Nothing. I havent found something to be so lightweight for a raspberry to handle. It makes sense by the way… This is face recognition after all. I wouldnt expect anything more. It might be a good idea to have a raspberry dedicated for this only. That would make sense.

So, for now I am not using face recognition. I used it once (that period of my post above) but then I realized I was taking resources from the rpi that I could use in more important things. I hope someday I will upgrade to a NUC.

All right. Thanks for your answer. I know there are a lot of services for face recognition. I saw a couple of guys that configured them on Raspberry pi and given they cost almost nothing it is easy to setup your own in there.

Hi Javier i use this link like reference https://www.home-assistant.io/docs/configuration/
so example in my case use hassio in a raspberry so, i use this

image_processing:
- platform: dlib_face_identify
source:
- entity_id: camera.eye_3
faces:
Jack: /config/www/faces/d.jpg

i hope this example can help you, i dont have any problem now with the validate yaml, now i need to test it

Hey,

I moved my installation to a NUC, so now I have a bit more power than my Rpi3.
Then I set up the dlib face detect component, and it also seems to detect objects - now I just needs to test and see if it can recognize the pictures uploaded.

Working conf;

image_processing:
 - platform: dlib_face_identify
   source:
    - entity_id: camera.protect_baghave_stue
   faces:
     Man: /config/www/faces/man.jpg
     Woman: /config/www/faces/woman.jpg

Have anyone succesfully created an automation that sends a notification when a known person is detected?

1 Like

I have the same question. If you know already, kindly answer. Thanks

Hi Shah,

I’m sorry but I moved to Deepstack instead.
Seems to work better for my needs and I do also have various automation that works.