HUB
Sign inSign up

arcturusnetworks/facerec

By arcturusnetworks

•Updated over 6 years ago

Image
0

589

arcturusnetworks/facerec repository overview

⁠Facial Recognition Pipeline

⁠Quick Start

NOTE: You only have to issue this (mega) command once (unless you pulled a new version of the facerec image). This is because the --restart unless-stopped flag tells docker to ensure that the container is always up and running, even after a reboot.

$ docker stop facerec && docker rm facerec &> /dev/null; \
  docker run -dit -v /CCA/known_faces:/src/data/known_faces -p 7777:7777 -p 109:109 --device /dev/video0 --ipc host \
--restart unless-stopped --name facerec arcturusnetworks/facerec && \
docker logs facerec -f
⁠Live Notifications on Port 109

You can receive live face recognition notifications on TCP port 109. For example, you can access them via telnet:

$ telnet 192.168.100.75 109
Trying 192.168.100.75...
Connected to 192.168.100.75.
Escape character is '^]'.
NF[name="Harshad Mahadik", eucldist=0.557691, timestamp="2020-03-12T19:50:19+0000"]
NF[name="Harshad Mahadik", eucldist=0.598658, timestamp="2020-03-12T19:50:23+0000"]
⁠MJPEG Stream

You can access the processed video output at HTTP port 7777.

⁠Customization

The following sections describe how to customize various aspects of the facial recognition pipeline.

⁠Editing pipeline.ini

This is a configuration file which is loaded at runtime by the face recognition app. To edit it,

$ docker exec -it facerec bash -c 'vim pipeline.ini'
# make changes and save pipeline.ini, then restart container to apply changes
$ docker commit facerec arcturusnetworks/facerec:latest && docker restart facerec
⁠Adding New Faces To Recognize

Before the pipeline starts running it trains a facial recognition engine with a set of images which contain faces to recognize. To add/remove images, ftp the images to the /known_faces directory on the host. Then, restart the container.

# upload your images to /known_faces via ftp, then
$ docker restart facerec

Note The pipeline example assumes that the file types of all images are .jpg, .png , or a serialized .dat file (auto-generated).

⁠Minimum Euclidean Distance

The facial recognition uses Euclidean distance as a metric for matching detected faces to known faces. This metric measures how closely a detected face matches a known face on a scale of 0 - 1; the smaller the Euclidean distance, the stronger the confidence in the match. So, 0.6 = good match, 0.55 = slightly stricter, 0.5 = very strict, etc. while 0 = perfect match.

To change this threshold, modify the following entry in pipeline.ini

[facerec]
...
eucldistThreshold=0.6
⁠Video Source

By default the pipeline is recognizing faces from a local USB webcam (/dev/video0). This can be changed to a different source by modifying pipeline.ini

[videosource]
uri=/dev/video0
Tag summary
Recent tags
Content type
Image
Digest
Size
817 MB
Last updated
over 6 years ago
docker pull arcturusnetworks/facerec:latest