FaceAnalyser class
Provides methods for analysing the characteristics of portrait image.
- Implemented types
Constructors
- FaceAnalyser()
- Creates a new instance of the FaceAnalyser class.
-
FaceAnalyser.fromHandle(Pointer<
id3FaceAnalyser> handle) - Creates a new instance of the FaceAnalyser class.
Properties
- expressionSensibility ↔ int
-
Sensibility of the expression classifier.
The higher the value, the more sensitive the algorithm will be, meaning that it will be less likely to estimate neutral expression out of the detected face.
Hint: Default value is 60.
getter/setter pair
-
handle
→ Pointer<
id3FaceAnalyser> -
Gets the native handle.
return The native handle.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- overExposureSensibility ↔ int
-
Sensibility of the over-exposure classifier, from 0 to 255.
The lower the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate over-exposed face images.
Hint: Default value is 188.
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 analysis.
Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
getter/setter pair
- underExposureSensibility ↔ int
-
Sensibility of the under-exposure classifier, from 0 to 255.
The higher the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate under-exposed face images.
Hint: Default value is 66.
getter/setter pair
Methods
-
applyAlphaMask(
Image image, Image mask) → Image - Applies an alpha mask to suppress the background and returns a 32-bit BGRA image.
-
applyMask(
Image image, Image mask, int red, int green, int blue) → Image - Applies a mask to replace the background with the specified color and returns a 24-bit BGR image.
-
checkColorizedImage(
Image image) → bool - Verifies if an image is colorized or grayscale.
-
computeAge(
Image image, DetectedFace detectedFace) → int -
Computes the age of a detected face.
Important: Loading the
FaceAgeEstimatormodel is required to use this function. -
computeAttributes(
Image image, DetectedFace detectedFace) → FaceAttributes -
Computes the attributes of a detected face.
Important: Loading the model
FaceAttributesClassifieris required to use this function. -
computeBackgroundUniformity(
Image image, DetectedFace detectedFace) → BackgroundUniformity -
Computes the background uniformity behind a detected face.
This function must be used for a portrait image with only one face in it. A high uniformity score means that the background is uniform.
Important: Loading the model
FaceBackgroundUniformityis required to use this function. -
computeExpression(
Image image, DetectedFace detectedFace) → FaceExpression -
Computes the expression of a detected face.
Important: Loading the
FaceExpressionClassifiermodel is required to use this function. -
computeEyeGaze(
Image image, DetectedFace detectedFace, PointList landmarks) → EyeGaze -
Computes the eye gaze of a detected face.
Important: Loading the
EyeGazeEstimatormodel is required to use this function. -
computeEyeOpenness(
Image image, DetectedFace detectedFace, PointList landmarks) → List< int> -
Computes the eye openness of a detected face.
The minimum recommanded value for is 90.
Important: Loading the
EyeOpennessDetectormodel is required to use this function. -
computeEyeRedness(
Image image, DetectedFace detectedFace, PointList landmarks) → List< int> -
Computes the eye redness of a detected face.
The maximum recommanded value for an ICAO-compliant portrait is 10.
Important: Loading the
EyeRednessDetectormodel is required to use this function. -
computeGeometricAttributes(
Image image, DetectedFace detectedFace, PointList landmarks) → GeometricAttributes - Computes the geometric attributes of a detected face. This function must be used for a portrait image with only one face in it.
-
computeGlassesAttributes(
Image image, DetectedFace detectedFace, PointList landmarks) → GlassesAttributes - Computes the glasses attributes of a detected face. This function must be used for a portrait image with only one face in it.
-
computeLandmarks(
Image image, DetectedFace detectedFace) → PointList -
Computes 68 landmarks of a detected face.
Important: Loading the
FaceLandmarksEstimatormodel is required to use this function. -
computeNoise(
Image image) → int - Measures the image noise.
-
computePhotographicAttributes(
Image image, DetectedFace detectedFace, PointList landmarks) → PhotographicAttributes - Computes the photographic attributes of a detected face. This function must be used for a portrait image with only one face in it.
-
computePose(
DetectedFace detectedFace) → FacePose -
Computes the pose of a detected face.
Important: Loading the
FacePoseEstimatormodel is required to use this function. -
computePoseWithLandmarks(
DetectedFace detectedFace, PointList landmarks) → FacePose -
Computes the pose of a detected face using the specified 68-point landmarks.
Loading the model
FacePoseEstimator1Ais required to use this function. -
detectFaceMask(
Image image, DetectedFace detectedFace) → int -
Detects the presence of a face mask on a detected face.
A high score means that there is a high chance that the person is wearing a mask.
The minimum recommended threshold is 15.
Important: Loading the
FaceMaskClassifier, model is required to use this function. -
detectOcclusions(
Image image, DetectedFace detectedFace) → FaceOcclusionScores -
Detects occlusions on the subject's face.
Important: This function requires the
FaceOcclusionDetectormodel to be loaded. -
dispose(
) → void - Releases all resources used by this FaceAnalyser.
-
getExpressionSensibility(
) → int - Gets the sensibility of the expression classifier. The higher the value, the more sensitive the algorithm will be, meaning that it will be less likely to estimate neutral expression out of the detected face. Hint: Default value is 60.
-
getOverExposureSensibility(
) → int - Gets the sensibility of the over-exposure classifier, from 0 to 255. The lower the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate over-exposed face images. Hint: Default value is 188.
-
getThreadCount(
) → int - Gets the number of threads to be used for face analysis. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
-
getUnderExposureSensibility(
) → int - Gets the sensibility of the under-exposure classifier, from 0 to 255. The higher the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate under-exposed face images. Hint: Default value is 66.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCompressionArtifacts(
Image image) → Image -
Upscale and enhance the image of a face.
Important: This methods requires the
CompressionArtifactRemovermodel to be loaded. -
segmentBackground(
Image image) → Image -
Computes face segmentation mask for background removal.
Important: This methods requires the
FaceBackgroundSegmentermodel to be loaded. -
segmentFace(
Image image) → Image -
Computes a segmentation map of a face.
Important: This methods requires the
FaceSegmentermodel to be loaded. -
setExpressionSensibility(
int expressionSensibility) → void - Sets the sensibility of the expression classifier. The higher the value, the more sensitive the algorithm will be, meaning that it will be less likely to estimate neutral expression out of the detected face. Hint: Default value is 60.
-
setOverExposureSensibility(
int overExposureSensibility) → void - Sets the sensibility of the over-exposure classifier, from 0 to 255. The lower the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate over-exposed face images. Hint: Default value is 188.
-
setThreadCount(
int threadCount) → void - Sets the number of threads to be used for face analysis. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
-
setUnderExposureSensibility(
int underExposureSensibility) → void - Sets the sensibility of the under-exposure classifier, from 0 to 255. The higher the value, the more sensitive the algorithm will be, meaning that it will be more likely to estimate under-exposed face images. Hint: Default value is 66.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited