FaceAlignment
Performs face alignment in preparation for face recognition.
This module provides a pipeline element to perform the necessary preprocessing to prepare the input image for input into the face recognition model. This is done by applying an affine transform to the image to align the image's landmarks with the reference landmarks. This module is configured for arcface. Other embedding models may require different preprocessing.
Examples:
REST API:
WIP
Configuration File:
```yaml
elements:
- name: infer
args:
model: yolov5s-face
- name: demux
- name: face-alignment
- name: infer
args:
model: arcface
- name: mux
- name: arcface-identifier
args:
database: redis
sources:
- address: videos/sample.mp4
type: file
```
FaceAlignment Objects
class FaceAlignment(Element)
Performs face alignment in preparation for face recognition.
Attributes:
name
str - Name of the element.
Examples:
```python
ele = FaceAlignment()
```
process
def process(meta: PipelineMetadata)
Process each frame in the metadata and perform face alignment.
This is the main function for the element. This element functions after a demux which means the image has been partitioned into separate meta elements for re-id. This does face alignment before sending it to the re-id. If there is no detection send it on to the next element
Arguments:
meta
PipelineMetadata - The metadata to process.
Returns:
meta
PipelineMetadata - The processed metadata.
Examples:
```python
ele = FaceAlignment()
meta = ele.process(meta)
```