enableFaceDetection method

FutureOr<int> enableFaceDetection(
  1. IFaceDetectionObserver observer,
  2. int interval,
  3. String modelPath
)

@detail api @author wangjunlin.3182 @brief Starts face detection and registers the observer for the result.
With this observer, you will receive onFaceDetectResult{@link #IFaceDetectionObserver#onFaceDetectResult} periodically. @param observer See IFaceDetectionObserver{@link #IFaceDetectionObserver}. @param intervalMs The minimum time interval between two callbacks in milliseconds. The value should be greater than 0. The actual time interval is between interval_ms and interval_ms+the time slot of a captured video frame. @param faceModelPath The absolute path of the face detection algorithm file. Typically it is the tt_face_vXXX.model file in the ttfacemodel folder. @return - 0: Success. - –1000: The Effects SDK is not integrated. - –1001: This API is unavailable for your Effects SDK. - –1002: Your Effects SDK's version is incompatible. - -1004: Initializing. This function will be available when the initialization is completed. - < 0: Other error. See error code table for specific instructions.

Implementation

FutureOr<int> enableFaceDetection(
    IFaceDetectionObserver observer, int interval, String modelPath) async {
  return await nativeCall(
      'enableFaceDetection', [observer, interval, modelPath]);
}