General¶
Before you can call the SDK functions, you must first initialize the SDK with your desired configuration options. These configuration options will ultimately impact the behaviour of the SDK, so be sure to read through what each one does carefully.
Once you have initialized the SDK, then proceed to the the License section.
-
SDK.
__init__
(*args, **kwargs)¶ Overloaded function.
__init__(self: tfsdk.SDK) -> None
Initialize the SDK using default configuration options.
__init__(self: tfsdk.SDK, arg0: Trueface::ConfigurationOptions) -> None
Initialize the SDK using custom configuration options.
-
static
SDK.
get_version
() → str¶ Get the SDK version
-
class
tfsdk.
FACIALRECOGNITIONMODEL
¶ Facial recognition models
Members:
LITE : Lightweight model with faster inference time, ideal for embedded systems or CPU only deployments, and for 1 to 1 matching use cases.
FULL : Full model with improved accuracy. Ideal for GPU deployments, and for 1 to N use cases.
-
class
tfsdk.
OBJECTDETECTIONMODEL
¶ Object detection models
Members:
ACCURATE
FAST
-
class
tfsdk.
FACEDETECTIONMODE
¶ Face detection modes
Members:
ROBUST : The ROBUST mode is optimized for face recognition, smallestFaceHeight less than 80 pixels will be overridden.
VERSATILE : The VERSATILE mode can detect small faces (as small as 16x16 pixel) and can be faster than the ROBUST mode.
-
class
tfsdk.
FACEDETECTIONFILTER
¶ Face detection filter
Members:
HIGH_RECALL : The detected face scores are thresholded to have a low precision and a high recall rate.
HIGH_PRECISION : The detected face scores are thresholded to have a high precision and a low recall rate.
BALANCED : The detected face scores are thresholded to have a medium precision and recall rate.
UNFILTERED : The detected face scores are not thresholded.
-
class
tfsdk.
DATABASEMANAGEMENTSYSTEM
¶ Database Management System for storing Faceprints
Members:
SQLITE : Use sqlite backend. Write Faceprints to local disk. Ideal for embedded systems or use cases where only one process connects to the database.
POSTGRESQL : Use PostgreSQL backend. Ideal for distributed systems requiring synchronization.
NONE : Do not write Faceprints to disk, only store in ram. Warning, enrolled Faceprints will not be saved after the program terminates. Switching to a new collections will also delete all enrolled templates.
-
class
tfsdk.
EnableGPU
¶ Enable GPU support (default is false). Note, GPU support requires a different version of the SDK. You are able to enable GPU for all modules or only specific modules.
-
property
face_detector
¶ Enable GPU inference for face detection
-
property
face_recognizer
¶ Enable or disable GPU inference for all modules
-
property
-
EnableGPU.
__init__
(*args, **kwargs)¶ Overloaded function.
__init__(self: tfsdk.EnableGPU) -> None
Default constructor initializes GPU inference for all modules to false
__init__(self: tfsdk.EnableGPU, arg0: bool) -> None
Enable or disable GPU inference for all modules.
-
class
tfsdk.
ConfigurationOptions
¶ -
property
GPU_device_index
¶ GPU device index (default is 0)
-
property
dbms
¶ Database management system for storing Faceprints (default is SQLITE). See DATABASEMANAGEMENTSYSTEM
-
property
enable_GPU
¶ Enable GPU support (default is false). Note, GPU support requires a different version of the SDK. You are able to enable GPU for all modules or only specific modules. See EnableGPU
-
property
fd_filter
¶ The face detection precision-recall mode (default is BALANCED). See FACEDETECTIONFILTER
-
property
fd_mode
¶ The face detection mode (default is VERSATILE). See FACEDETECTIONMODE
-
property
fr_model
¶ The model to be used for facial recognition (default is LITE model). See FACIALRECOGNITIONMODEL
-
property
fr_vector_compression
¶ Improves the computation speed for 1 to 1 comparisons and 1 to N searches.Also reduces the feature vector length. (default is False)
-
property
models_path
¶ The directory path containing the model files (default is ./ )
-
property
obj_model
¶ The model to be used for object detection (default is ACCURATE model). See OBJECTDETECTIONMODEL
-
property
smallest_face_height
¶ The smallest face height that the face detector can detect (default is 40 pixels). The face detector has a detection scale range of about 5 octaves. Ex. 40 pixels yields the detection scale range of ~40 pixels to 1280 (=40x2^5) pixels. If set to -1, will dynamically adjusts the face detection scale range from image-height/32 to image-height to ensure that large faces are detected in high resolution images.
-
property
-
class
tfsdk.
CollectionMetadata
¶ -
property
collection_name
¶ The name of the collection.
-
property
feature_vector_size_bytes
¶ The size of the Faceprint feature vector in bytes.
-
property
model_name
¶ The name of the face recognition model used to generate the Faceprints enrolled in the collection.
-
property
model_options
¶ Additional options which were used to generate Faceprints enrolled in the collection.
-
property
num_faceprints
¶ The total number of Faceprints enrolled in the collection.
-
property
num_identities
¶ The number of unique identities in the collection.
-
property
-
class
tfsdk.
ERRORCODE
¶ Members:
NO_ERROR
INVALID_LICENSE
FILE_READ_FAIL
UNSUPPORTED_IMAGE_FORMAT
UNSUPPORTED_MODEL
NO_FACE_IN_FRAME
COLLECTION_CREATION_ERROR
DATABASE_CONNECTION_ERROR
ENROLLMENT_ERROR
FAILED
NO_RECORD_FOUND
NO_COLLECTION_FOUND
MAX_COLLECTION_SIZE_EXCEEDED
COLLECTION_DELETION_ERROR