FaceTracker class
Tracks faces on consecutive images and automatically creates and updates associated face templates.
- Implemented types
Constructors
- FaceTracker()
- Creates a new instance of the FaceTracker class.
-
FaceTracker.fromHandle(Pointer<
id3FaceTracker> handle) - Creates a new instance of the FaceTracker class.
Properties
- confidenceThreshold ↔ int
-
Confidence threshold, in the range
0;100. Hint: Default value is 50. Note: Setting a high threshold reduces false detection but can increase the number of undetected faces.getter/setter pair - detectionModel ↔ FaceModel
-
Model used to detect and track faces.
Hint: Default value is FaceDetector4B.
Note: Some better accuracy/speed balances can be found by choosing another model.
getter/setter pair
- encodingModel ↔ FaceModel
-
Model used to create features and assess consistancy among views of a given face.
Hint: Default value is FaceEncoder9B. Some better accuracy/speed balances can be found by choosing another model.
getter/setter pair
-
handle
→ Pointer<
id3FaceTracker> -
Gets the native handle.
return The native handle.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- matchThreshold ↔ int
-
Minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'.
Hint: Default value is 3000 which corresponds to a False Match Rate of 1/1000.
getter/setter pair
- maximumTrackedFaceAge ↔ int
-
Maximum number of consecutive non-detections to reach before deleting a tracked face.
Hint: Default value is 30 which corresponds to 2s at a frame rate of 15 FPS. One must adapt this value to its needs in terms of tracker identity memory (in seconds) and measured frame rate on target platform.
getter/setter pair
- minimumTrackedFaceAge ↔ int
-
Minimum number of consecutive detections to reach before creating a tracked face.
Hint: Default value is 1 for FaceDetector4B since the false detection rate is low enough. If using a less accurate detector (such as FaceDetector3C) one might consider increasing a bit this value to avoid false tracks.
getter/setter pair
- nmsIouThreshold ↔ int
-
Non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is
0;100. Hint: Default value is 40. Setting a high threshold allows to detect more overlapping faces which can be useful in a multi-face scenario. On the contrary, in a portrait scenario, a low NMS IOU threshold should be preferred.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- threadCount ↔ int
-
Number of threads to be used for face detection and tracking.
Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
getter/setter pair
Methods
-
detectFaces(
Image image, TrackedFaceList trackedFaceList) → void -
Detects faces in an image and update their info in a TrackedFaceList object.
The algorithm searches for faces in the range (16px;512px). If the image is too large to fit this range, one must resize it before the tracking process.
In a realtime process, one must use this function to keep the face IDs stable in time.
Important: Loading a
FaceDetectoris required to use this function. -
dispose(
) → void - Releases all resources used by this FaceTracker.
-
getConfidenceThreshold(
) → int - Gets the confidence threshold, in the range (0;100). Hint: Default value is 50. Note: Setting a high threshold reduces false detection but can increase the number of undetected faces.
-
getDetectionModel(
) → FaceModel - Gets the model used to detect and track faces. Hint: Default value is FaceDetector4B. Note: Some better accuracy/speed balances can be found by choosing another model.
-
getEncodingModel(
) → FaceModel - Gets the model used to create features and assess consistancy among views of a given face. Hint: Default value is FaceEncoder9B. Some better accuracy/speed balances can be found by choosing another model.
-
getMatchThreshold(
) → int - Gets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'. Hint: Default value is 3000 which corresponds to a False Match Rate of 1/1000.
-
getMaximumTrackedFaceAge(
) → int - Gets the maximum number of consecutive non-detections to reach before deleting a tracked face. Hint: Default value is 30 which corresponds to 2s at a frame rate of 15 FPS. One must adapt this value to its needs in terms of tracker identity memory (in seconds) and measured frame rate on target platform.
-
getMinimumTrackedFaceAge(
) → int - Gets the minimum number of consecutive detections to reach before creating a tracked face. Hint: Default value is 1 for FaceDetector4B since the false detection rate is low enough. If using a less accurate detector (such as FaceDetector3C) one might consider increasing a bit this value to avoid false tracks.
-
getNmsIouThreshold(
) → int - Gets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is (0;100). Hint: Default value is 40. Setting a high threshold allows to detect more overlapping faces which can be useful in a multi-face scenario. On the contrary, in a portrait scenario, a low NMS IOU threshold should be preferred.
-
getThreadCount(
) → int - Gets the number of threads to be used for face detection and tracking. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setConfidenceThreshold(
int confidenceThreshold) → void - Sets the confidence threshold, in the range (0;100). Hint: Default value is 50. Note: Setting a high threshold reduces false detection but can increase the number of undetected faces.
-
setDetectionModel(
FaceModel detectionModel) → void - Sets the model used to detect and track faces. Hint: Default value is FaceDetector4B. Note: Some better accuracy/speed balances can be found by choosing another model.
-
setEncodingModel(
FaceModel encodingModel) → void - Sets the model used to create features and assess consistancy among views of a given face. Hint: Default value is FaceEncoder9B. Some better accuracy/speed balances can be found by choosing another model.
-
setMatchThreshold(
int matchThreshold) → void - Sets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'. Hint: Default value is 3000 which corresponds to a False Match Rate of 1/1000.
-
setMaximumTrackedFaceAge(
int maximumTrackedFaceAge) → void - Sets the maximum number of consecutive non-detections to reach before deleting a tracked face. Hint: Default value is 30 which corresponds to 2s at a frame rate of 15 FPS. One must adapt this value to its needs in terms of tracker identity memory (in seconds) and measured frame rate on target platform.
-
setMinimumTrackedFaceAge(
int minimumTrackedFaceAge) → void - Sets the minimum number of consecutive detections to reach before creating a tracked face. Hint: Default value is 1 for FaceDetector4B since the false detection rate is low enough. If using a less accurate detector (such as FaceDetector3C) one might consider increasing a bit this value to avoid false tracks.
-
setNmsIouThreshold(
int nmsIouThreshold) → void - Sets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is (0;100). Hint: Default value is 40. Setting a high threshold allows to detect more overlapping faces which can be useful in a multi-face scenario. On the contrary, in a portrait scenario, a low NMS IOU threshold should be preferred.
-
setThreadCount(
int threadCount) → void - Sets the number of threads to be used for face detection and tracking. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
-
toString(
) → String -
A string representation of this object.
inherited
-
trackFaces(
Image image, TrackedFaceList trackedFaceList) → void -
Tracks faces in an image and update their info in a TrackedFaceList object.
The algorithm searches for faces in the range (16px;512px). If the image is too large to fit this range, one must resize it before the tracking process.
In a realtime process, one must use this function to keep the face IDs stable in time.
Important: Loading a
FaceDetectorand aFaceEncodermodel is required to use this function. -
warmUp(
int imageWidth, int imageHeight) → void -
Gets the face tracker module ready to work on a specific image size by initializing all its internal memory layout.
This function can be called after setting all the parameters of the face detector module if the image size is fixed, for example using frames from a video stream.
Calling this function is not mandatory as the internal memory layout is automatically initialized in the first call to detectFaces() or trackFaces() if missing.
Important: Loading a
FaceDetectormodel is required to use this function.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited