Class FaceFinder


  • public class FaceFinder
    extends Object
    Combination of FaceDetector and FaceScanner for workloads where both face detection and face scanning are required. However, this class makes no assumptions about the workload and is therefore bare-bones. Because of this, usage of a task-specific class like FaceRecognizer is highly recommended, unless these do not fit your use case.
    • Method Detail

      • create

        public static FaceFinder create​(Context ctx,
                                        float minConfidence,
                                        int inputWidth,
                                        int inputHeight,
                                        int sensorOrientation,
                                        boolean hwAcceleration,
                                        boolean enhancedHwAcceleration,
                                        int numThreads)
        Create new FaceFinder instance.
        Parameters:
        ctx - Android Context object, may be in background.
        minConfidence - Minimum confidence to track a detection, must be higher than 0.0f and smaller than 1.0f
        inputWidth - width of the Bitmaps that are going to be processed
        inputHeight - height of the Bitmaps that are going to be processed
        sensorOrientation - rotation if the image should be rotated, or 0.
        hwAcceleration - Enable hardware acceleration (NNAPI/GPU)
        enhancedHwAcceleration - if hwAcceleration is enabled, use NNAPI instead of GPU. if not, this toggles XNNPACK
        numThreads - How many threads to use, if running on CPU or with XNNPACK
        Returns:
        FaceFinder instance
        See Also:
        create(Context, float, int, int, int)
      • create

        public static FaceFinder create​(Context ctx,
                                        float minConfidence,
                                        int inputWidth,
                                        int inputHeight,
                                        int sensorOrientation)
        Create new FaceFinder instance with sensible defaults regarding hardware acceleration (CPU, XNNPACK, 4 threads).
        Parameters:
        ctx - Android Context object, may be in background.
        minConfidence - Minimum confidence to track a detection, must be higher than 0.0f and smaller than 1.0f
        inputWidth - width of the Bitmaps that are going to be processed
        inputHeight - height of the Bitmaps that are going to be processed
        sensorOrientation - rotation if the image should be rotated, or 0.
        Returns:
        FaceFinder instance
        See Also:
        create(Context, float, int, int, int, boolean, boolean, int)