3DiVi Face SDK
3.24.1
|
Classes | |
class | face_sdk.modules.raw_sample.Angles |
Face orientation angles. More... | |
class | face_sdk.modules.raw_sample.ImageFormat |
Image formats for saving. More... | |
class | face_sdk.modules.raw_sample.SampleType |
Sample types (see also VDT.FaceRecognition.SDK.Capturer.CapturerType). More... | |
class | face_sdk.modules.raw_sample.FaceCutType |
Face cropping types. More... | |
class | face_sdk.modules.raw_sample.RawSample |
Interface object that stores a captured face sample. More... | |
def face_sdk.modules.raw_sample.Angles.__init__ | ( | self, | |
yaw | |||
) |
Yaw angle in degrees.
Pitch angle in degrees.
Roll angle in degrees.
def face_sdk.modules.raw_sample.RawSample.cut_face_image | ( | self, | |
binary_stream | |||
) |
Crop the face and save in the specified format.
Thread-safe.
[in] | binary_stream | Output stream object for image saving. The file stream (BytesIO) (if any) |
[in] | format | Image encoding format. |
[in] | cut_type | Face cropping types. |
def face_sdk.modules.raw_sample.RawSample.cut_face_raw_image | ( | self, | |
color_model | |||
) |
def face_sdk.modules.raw_sample.RawSample.downscale_to_preferred_size | ( | self | ) |
Clone this RawSample with an internal face image downscaled to preferred size and without an original image.
In order to reduce memory consumption (both in RAM and after serialization).
At work Capturer and VideoWorker automatically downscale all RawSamples if downscale_rawsamples_to_preferred_size parameter is enabled (enabled by default), but it decreases the performance.
So it is recommended to disable downscale_rawsamples_to_preferred_size and use RawSample.downscaleToPreferredSize manually for RawSamples that you need to save or hold for a long time in RAM.
def face_sdk.modules.raw_sample.RawSample.get_angles | ( | self, | |
Angles | |||
) |
Get a face orientation.
Only frontal samples. Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_face_cut_rectangle | ( | self, | |
cut_type | |||
) |
Get a cropping rectangle (for preview) that will be used in cutFaceImage.
Thread-safe.
[in] | cut_type | Face cropping types. |
def face_sdk.modules.raw_sample.RawSample.get_face_visibility_score | ( | self, | |
float | |||
) |
Get the score of face visibility.
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_frame_id | ( | self, | |
int | |||
) |
Get an ID of the frame, in which this RawSample is detected (for samples made with VideoWorker).
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_id | ( | self, | |
int | |||
) |
Get a face ID.
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_iris_landmarks | ( | self, | |
List, | |||
Point | |||
) |
Get the characteristic points of the eyes.
Only frontal samples. Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_landmarks | ( | self, | |
List, | |||
Point | |||
) |
Get anthropometric landmarks.
Only frontal samples. Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_left_eye | ( | self, | |
Point | |||
) |
Get a point of the left eye.
Only frontal samples. Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_original_image | ( | self, | |
RawImage | |||
) |
Get an original image.
Throws an exception if a sample doesn’t contain an original image (check with hasOriginalImage (RawSample) first). Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_rectangle | ( | self, | |
Rectangle | |||
) |
def face_sdk.modules.raw_sample.RawSample.get_right_eye | ( | self, | |
Point | |||
) |
Get a point of the right eye.
Only frontal samples. Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_score | ( | self, | |
float | |||
) |
Get the score of the detected face (for samples made with supported single-shot Capturers).
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.get_type | ( | self, | |
int | |||
) |
Get a sample type.
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.has_original_image | ( | self, | |
int | |||
) |
Does the sample store the original image (True for samples made with VideoWorker with enabled store_original_frame_in_raw_sample).
Thread-safe.
def face_sdk.modules.raw_sample.RawSample.save | ( | self, | |
binary_stream | |||
) |
Save (serialize) the sample.
Original image will not be saved (i.e. only the part of an image containing the face is saved). The format is platform-independent. Thread-safe. After saving, you can load it with FacerecService.load_raw_sample.
[in] | binary_stream | Output stream object for saving the raw sample. The file stream (BytesIO) (if any). |
[in] | format | Image encoding format. |
def face_sdk.modules.raw_sample.RawSample.save_without_image | ( | self, | |
binary_stream | |||
) |
Save (serialize) all sample information except the image.
You have to store the image on your own in order to pass it to the FacerecService.load_raw_sample_without_image for deserialization. If you transformed the image in soma way, you can set the parameters of coordinate space transformation: (x, y) -> ( (x + space_translation_x) * space_scale, (y + space_translation_y) * space_scale ) that will be applied to the information about face position. Note that you must set the same transformation only once - either during serialization or during deserialization, otherwise transformation will be applied twice, which is wrong. The format is platform-independent. Thread-safe. After saving, you can load it with FacerecService.load_raw_sample_without_image.
[in] | binary_stream | Output stream object for saving the raw sample. The file stream (BytesIO) (if any). |
[in] | space_translation_x | Coordinate space transform parameter. |
[in] | space_translation_y | Coordinate space transform parameter. |
[in] | space_scale | Coordinate space transform parameter. |
def face_sdk.modules.raw_sample.RawSample.to_context | ( | self | ) |
will transform RawSample into a container-Context