Execute the following steps to detect and recognize faces:
Execute Steps 1 to 3 once in a typical application. The person store, face detector, and recognizer objects should be reused whenever possible.
Note: The face detector and recognizer objects are not thread safe. Make sure only one face detection/recognition operation is executed on a single detector/recognizer object at any given time. However, you may create multiple separate detector/recognizer objects and use them in parallel from different threads.
When processing a video file, execute Step 4 on every frame or every other frame of the video file. Inspect the detected faces and decide which ones are of sufficient quality to attempt recognition on. Face recognition should be rate limited to approximately one (1) recognition per face since it is significantly more costly than face detection.
Note: Changes to a person store are not automatically saved. The changes are applied in memory and you must explicitly save the person store when it makes sense for your application.