Blocks for working with facial recognition and images
Find a face encoding from an image file, send encoding and other data as signal
- Image Path: Full path to the image file that will be added
- User ID: Id of the face being added to the database
- Save Name: Name of the face being added to the database
- face_recognition
- pickle
- base64
- Any signal to trigger the block to run
- A signal containing the facial encoding, user id, and name
sample output:
{
'encoding': 'gANjbnVtcHkuY29yZS5tdWx0aWFycmF5Cl9yZWNvbn...',
'name': 'Barack',
'user_id': 'bobama'
}
Grab a frame of video from a specified camera and send the frame data as a signal.
- opencv-python
- pickle
- base64
- urllib.request
- numpy
- Any signal to trigger a frame being grabbed from the specified camera
- A signal containing the serialized and stringified video frame
Grab a frame of video from a specified camera, find a face encoding within the frame, compare the encoding with encoding of known faces from an input signal, output a signal containing the name of the found face.
- face_recognition
- opencv-python
- pickle
- base64
- urllib.request
- numpy
- A signal through "unknown" to begin collecting frames from the camera and search for faces.
- A signal through "known" to add the known face encodings and names to compare found faces against. Expects a 'faces' object which contains a list of objects with attributes
'name'
,'user_id'
,'id'
, and'encoding'
.
sample known input:
{
'faces': [
{
'name': 'Barack',
'user_id': 'bobama',
'id': '4999011a-8ded-49c4-a927-77a09dcdb578',
'encoding': 'gANjbnVtcHkuY29yZS5tdWx0aWFycmF5Cl9yZWNvbn...'
}
]
}
- A signal containing the name of the face identified from the webcam
sample output:
{
'found': 'Barack'
}