Article
home/blog/Loading

Resolve Howdy exception when adding your face

I wanted to setup face unlock on Linux with my new Dell XPS 13. This is how you can set it up for yourself!

Howdy is the goto Linux library for facial recognition. so I installed this. All was going well until I recievied the following error adding my face:

❯ sudo howdy add
Adding face model for the user john
Enter a label for this new model [Initial model] (max 24 characters): first
Camera path is not configured correctly, please edit the 'device_path' config value.
Exception ignored in: <function VideoCapture.__del__ at 0x7febda827550>
Traceback (most recent call last):
  File "/usr/lib/security/howdy/recorders/video_capture.py", line 55, in __del__
    self.internal.release()
AttributeError: 'VideoCapture' object has no attribute 'internal'

The Error explained

Howdy cannot detect which camera to use and as a result cannot see the face. We need to edit the howdy config to tell it explicitly which camera to use on the laptop.

Resolving the Error

Start by listing all video devices on your laptop:

ls -l /dev/v4l/by-id/

❯ ls -l /dev/v4l/by-id/
total 0
lrwxrwxrwx 1 root root 12 Mar  5 13:32 usb-CN03GGY48LG0009GB2RSA00_Integrated_Webcam_HD-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 Mar  5 13:32 usb-CN03GGY48LG0009GB2RSA00_Integrated_Webcam_HD-video-index1 -> ../../video3

You can also do this using the following command

v4l2-ctl --list-devices

Edit the Howdy config

howdy has a command for this:

sudo howdy config

Then navigate to the following line and set the path to the name of the device printed by the ls command above. Below is what my one looks like:

# The path of the device to capture frames from
# Should be set automatically by an installer if your distro has one
device_path = /dev/v4l/by-id/usb-CN03GGY48LG0009GB2RSA00_Integrated_Webcam_HD-video-index0

All is resolved

Done! You should now be able to add your face to the facial recognition engine using the following comand!

sudo howdy add