enableFaceDetection abstract method

Future<int?> enableFaceDetection({
  1. required RTCFaceDetectionObserver observer,
  2. required String modelPath,
  3. int interval = 0,
})

Starts face detection and registers the observer for the result.
With this observer, you will receive RTCFaceDetectionObserver.onFaceDetectResult periodically.

interval: 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.

modelPath: The absolute path of the face detection algorithm file. Typically it is the tt_face_vXXX.model file in the ttfacemodel folder.

Return value:

  • 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

Future<int?> enableFaceDetection({
  required RTCFaceDetectionObserver observer,
  required String modelPath,
  int interval = 0,
});