Isolates
Requirements
- Connected Flutter Plugin
Isolates
Isolates help eliminate freezes when launching heavy models. Some classes have received an asynchronous version.
- Capturer - AsyncCapturer(createAsyncCapturer)
- Recognizer - AsyncRecognizer(createAsyncRecognizer)
- ProcessingBlock - AsyncProcessingBlock(createAsyncProcessingBlock)
The principle of working with asynchronous versions remains the same. All methods for working with classes, as well as methods for creation, have become asynchronous.
Create isolates
Future<AsyncCapturer> createCapturer(FacerecService service) async {
return await service.createAsyncCapturer(Config("common_capturer_uld_fda.xml"));
}
Future<AsyncRecognizer> createRecognizer(FacerecService service) async {
return await service.createAsyncRecognizer("method12v30_recognizer.xml");
}
Future<AsyncProcessingBlock> createProcessingBlock(FacerecService service) async {
return await service.createAsyncProcessingBlock({
"unit_type": "LIVENESS_ESTIMATOR",
"modification": "2d_light",
"version": 1
});
}
Isolate usage demonstration
Demo Flutter sample with the Face SDK plugin is available in the examples/flutter/isolates_demo directory of Face SDK distribution kit.