3DiVi Face SDK
3.24.1
|
def face_sdk.modules.video_worker.SearchResult.__init__ | ( | self, | |
person_id | |||
) |
Unique id of the person.
Unique id of the element.
Result of template matching.
def face_sdk.modules.video_worker.TrackingCallbackData.__init__ | ( | self | ) |
Integer id of the video stream (0 <= stream_id < streams_count).
Integer id of the frame (that was returned by VideoWorker.add_video_frame).
Vector of face samples found by the tracker. Most of the samples are received from the frame_id frame but some samples can be received from the previous frames. Use RawSample.get_frame_id to determine which frame the sample belongs to.
Vector of face IDs (track_id). track_id is equal to sample.get_id() for the sample given in any VideoWorker callback. (samples_track_id.size() == samples.size())
Since this is tracking, some samples may be false, so we mark the samples with the "weak" flag if they haven’t passed the recheck with the frontal face detector. Weak samples are not used for recognition (samples_weak.size() == samples.size())
Quality value for the face sample. The same as from the FaceQualityEstimator (samples_quality.size() == samples.size())
The result of checking the sample for good lighting conditions and absence of a strong blur (samples_good_light_and_blur.size() == samples.size())
The result of checking the sample for absence of too high yaw/pitch angles (samples_good_angles.size() == samples.size())
The result of checking the sample for suitable size of a face, see the min_template_generation_face_size parameter in the configuration file. len(samples_good_face_size) == len(samples)
The result of checking the sample with the frontal face detector len(samples_detector_confirmed) == len(samples.size()
The result of checking the sample with DepthLivenessEstimator, depth frames are required, see VideoWorker.addDepthFrame. See face_sdk_3divi.modules.depth_liveness_estimator.Liveness for details. len(samples_depth_liveness_confirmed) == len(samples)
The result of checking the sample with IRLivenessEstimator, depth frames are required, see VideoWorker.addIRFrame. See face_sdk_3divi.modules.ir_liveness_estimator.Liveness for details. len(samples_ir_liveness_confirmed) == samples.size)
Flag indicating that age and gender were estimated for this track. len(samples_track_age_gender_set) == len(samples)
Estimated age and gender for this track. len(samples_track_age_gender) == len(samples)
Flag indicating that emotions were estimated for this track. len(samples_track_emotions_set) == len(samples)
Estimated emotions for this track. len(samples_track_emotions) == len(samples)
Face active liveness check status. See ActiveLiveness::ActiveLivenessStatus for details. (samples_active_liveness_status.size() == samples.size())
def face_sdk.modules.video_worker.TemplateCreatedCallbackData.__init__ | ( | self, | |
stream_id | |||
) |
Integer id of the video stream (0 <= stream_id < streams_count).
Integer id of the frame (that was returned by VideoWorker.add_video_frame).
Face sample quality. The same as from the FaceQualityEstimator.
Face sample.
Template created for this sample.
def face_sdk.modules.video_worker.MatchFoundCallbackData.__init__ | ( | self, | |
stream_id | |||
) |
Found elements with a distance less than distance_threshold (but not more than k nearest elements, the value of k is set in the configuration file tagged as search_k tag).
When called after N consecutive mismatches, the first element in search_results will have a zero distance, and person_id and element_id are equal to face_sdk_3divi.modules.video_worker.MATCH_NOT_FOUND_ID.
def face_sdk.modules.video_worker.TrackingLostCallbackData.__init__ | ( | self | ) |
Integer id of the video stream (0 <= stream_id < streams_count).
Integer id of the frame on which the face was first detected.
Integer id of the frame after which the face tracking was lost.
Best sample quality over all frames.
Integer id of the frame of the best quality.
ID of the lost face (track_id). track_id is equal to sample.get_id() for a sample given in any VideoWorker callback.
The best quality sample from the best_quality_frame_id frame. Will be NULL if "weak_tracks_in_tracking_callback" is enabled and all samples with that track_id are flagged as "weak=true".
Template created from best_quality_sample. Will be NULL if processing_threads_count is zero or best_quality_sample is NULL.
Flag indicating that sti_person_id is set. sti_person_id is not set, if short time identification is disabled or no templates were generated for this track.
ID of "sti_person", which is a set of tracks formed by short time identification. sti_person_id is equal to track_id of the first member of this "sti_person" set of tracks.
def face_sdk.modules.video_worker.StiPersonOutdatedCallbackData.__init__ | ( | self, | |
stream_id, | |||
sti_person_id | |||
) |
Integer id of the video stream (0 <= stream_id < streams_count).
ID of "sti_person", which is a set of tracks formed by short time identification. sti_person_id is equal to track_id of the first mebmer of this "sti_person" set of tracks.
def face_sdk.modules.video_worker.DatabaseElement.__init__ | ( | self, | |
element_id | |||
) |
Unique id of the element.
Unique id of the person.
Face template.
Distance threshold for a MatchFound event.
Setting a different recognition threshold for different persons may be useful in some cases. For example, if there is a particular criminal in the blacklist, who is more dangerous than the other criminals, and you want to increase the recognition probability for this very person, despite the higher probability of a false acceptance error.
def face_sdk.modules.video_worker.Params.__init__ | ( | self | ) |
Set the VideoWorker configuration file with optionally overridden parameters.
Set the name of the configuration file for Recognizer that will be used inside VideoWorker.
Set the configuration file with optionally overridden parameters for Recognizer that will be used inside VideoWorker.
Set the number of video streams.
Set the number of threads for creating templates.
Set the number of threads for matching templates with the database.
Set the number of threads for age_gender estimation.
Set the number of threads for estimation of emotions.
Set the flag enabling short time #identification.
Set the recognition distance threshold for short time identification.
Set outdate_time in seconds for short time #identification.
Set outdate_time in seconds for short time #identification.
Default constructor, set strings to empty, numbers to zero, flags to false.
def face_sdk.modules.video_worker.VideoWorker.add_depth_frame | ( | self, | |
depth_frame | |||
) |
Add a new depth frame for a specific stream.
Thread-safe.
[in] | depth_frame | Depth frame (DepthMapRaw) that contains depth data. |
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
[in] | timestamp_microsec | Timestamp of the frame in microseconds |
def face_sdk.modules.video_worker.VideoWorker.add_ir_frame | ( | self, | |
ir_frame | |||
) |
Add a new IR frame for a specific stream.
Thread-safe.
[in] | ir_frame | IR frame (IRFrameRaw) that contains IR data. |
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
[in] | timestamp_microsec | Timestamp of a frame in microseconds. |
def face_sdk.modules.video_worker.VideoWorker.add_match_found_callback_ext | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a MatchFound event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_match_found_callback_u | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a MatchFound event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_sti_person_outdated_callback_u | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a MatchFound event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_template_created_callback_u | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a TemplateCreated event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_tracking_callback_u | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a Tracking event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_tracking_lost_callback_u | ( | self, | |
callback, | |||
userdata, | |||
int | |||
) |
Add a handler for a MatchFound event.
Thread-safe.
[in] | callback | Callback function. |
[in] | userdata | Any pointer. It will be passed to the callback as a userdata argument. |
def face_sdk.modules.video_worker.VideoWorker.add_video_frame | ( | self, | |
frame | |||
) |
Add a new video frame for a specific video stream.
Tracking and recognition results will be returned asynchronously via Tracking, MatchFound and TrackingLost callbacks. Thread-safe.
[in] | frame | Video frame. Only colored images are allowed (i.e. face_sdk_3divi.modules.raw_image.Format.FORMAT_RGB, face_sdk_3divi.modules.raw_image.Format.FORMAT_BGR, face_sdk_3divi.modules.raw_image.format.FORMAT_YUV_NV21 and face_sdk_3divi.modules.raw_image.Format.FORMAT_YUV_NV12). |
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
[in] | timestamp_microsec | Timestamp of the frame in microseconds |
def face_sdk.modules.video_worker.VideoWorker.check_exception | ( | self | ) |
Exceptions from the callbacks and inner threads are rethrown when this method is called.
Thread-safe.
def face_sdk.modules.video_worker.VideoWorker.disable_age_gender_estimation_on_stream | ( | self, | |
stream_id | |||
) |
Disable age and gender estimation for a given stream.
Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.disable_emotions_estimation_on_stream | ( | self, | |
stream_id | |||
) |
Disable estimation of emotions for a given stream.
Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.disable_processing_on_stream | ( | self, | |
stream_id | |||
) |
Disable the creation of templates for a given stream.
After that, the matching stops as well. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.enable_age_gender_estimation_on_stream | ( | self, | |
stream_id | |||
) |
Enable age and gender estimation for a given stream.
Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.enable_emotions_estimation_on_stream | ( | self, | |
stream_id | |||
) |
Enable estimation of emotions for a given stream.
Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.enable_processing_on_stream | ( | self, | |
stream_id | |||
) |
Enable the creation of templates for a given stream.
After that, the matching is resumed as well. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.get_method_name | ( | self, | |
str | |||
) |
Get a method name of the recognizer used.
Thread-safe.
def face_sdk.modules.video_worker.VideoWorker.get_streams_count | ( | self | ) |
Get a number of video streams.
Thread-safe.
def face_sdk.modules.video_worker.VideoWorker.get_tracking_conveyor_size | ( | self, | |
stream_id | |||
) |
Get a size N of tracking conveyor.
Tracking callback will be called with frame_id = X not earlier than VideoWorker.add_video_frame returns the value X + N - 1, where N is the value returned by VideoWorker.get_tracking_conveyor_size. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.remove_match_found_callback | ( | self, | |
callback_id | |||
) |
Remove a handler for MatchFound event.
Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.add_match_found_callback. |
def face_sdk.modules.video_worker.VideoWorker.remove_sti_person_outdated_callback | ( | self, | |
callback_id | |||
) |
Remove a handler for StiPersonOutdated event.
Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.add_sti_person_outdated_callback. |
def face_sdk.modules.video_worker.VideoWorker.remove_template_created_callback | ( | self, | |
callback_id | |||
) |
Remove a handler for TemplateCreated event.
Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.add_template_created_callback. |
def face_sdk.modules.video_worker.VideoWorker.remove_tracking_callback | ( | self, | |
callback_id | |||
) |
Remove a handler for Tracking event.
Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.add_tracking_callback. |
def face_sdk.modules.video_worker.VideoWorker.remove_tracking_lost_callback | ( | self, | |
callback_id | |||
) |
Remove a handler for TrackingLost event.
Thread-safe.
[in] | callback_id | Integer callback id returned by VideoWorker.add_tracking_lost_callback. |
def face_sdk.modules.video_worker.VideoWorker.reset_stream | ( | self, | |
stream_id | |||
) |
Reset work state for the stream.
It waits for the callbacks, which are currently being executed, therefore, do not synchronize the resetStream call with the code inside the callbacks, otherwise it can cause a deadlock. After resetStream is executed, no callbacks related to the previous frames or tracks will be called. It is necessary to release the memory allocated for all tracks with track_id less than the return value, since there will be no TrackingLost callback for the tracks removed during this reset. Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.reset_tracker_on_stream | ( | self, | |
stream_id | |||
) |
Reset tracker state for a specified video stream.
Thread-safe.
[in] | stream_id | Integer id of the video stream (0 <= stream_id < streams_count). |
def face_sdk.modules.video_worker.VideoWorker.set_database | ( | self, | |
elements | |||
) |
Set / replace the database (can be called at any time).
Available only if matching_threads_count > 0. Thread-safe.
[in] | elements | Vector of database elements. |
[in] | acceleration | Acceleration type. |
def face_sdk.modules.video_worker.VideoWorker.set_parameter | ( | self, | |
parameter | |||
) |
Change the parameter value in runtime.
[in] | parameter | Parameter name (tag name in the .xml config file). |
[in] | value | New parameter value. |