createFromBuffer static method
Future<FaceDetection>
createFromBuffer(
- Uint8List modelBytes,
- FaceDetectionModel model, {
- PerformanceConfig? performanceConfig,
Creates a face detection model from pre-loaded model bytes.
This is primarily used by FaceDetector to initialize models in a background isolate where asset loading is not available.
The modelBytes parameter should contain the raw TFLite model file contents.
The model parameter specifies which model variant this is (for anchor generation).
Implementation
static Future<FaceDetection> createFromBuffer(
Uint8List modelBytes,
FaceDetectionModel model, {
PerformanceConfig? performanceConfig,
}) => _createWithLoader(
model: model,
load: (opts) => Interpreter.fromBuffer(modelBytes, options: opts),
performanceConfig: performanceConfig,
useIsolateInterpreter: false,
);