Reducing the app size for production
To reduce your app size, identify the set of Face SDK models and libraries directly used in the app and remove the rest.
Leave only used models
Processing Block API
The path to models is formed as follows _share/processing_block/{unit_type(lower case)}/{modification}/{version}.enc_
If there is no model file corresponding to {version} in the specified path, then the block uses the whole directory.
To compile a list of used models, follow the steps below:
- For each Context used to create the block, take unit_type, modification, version.
- Go to the path
_share/processing_block/{unit_type(lower case)}/{modification}_
. - If there is a file corresponding to {version} in the directory, copy that file.
- If there is no file corresponding to {version} in the directory, copy the entire directory.
Legacy API
The paths to the files used are described in the corresponding .xml files.
To compile a list of used files, follow thew steps below:
- For each capturer, recognizer, ... open the corresponding .xml file (if you use use_cuda, the required models will have the extension .dt).
- If the tag contains a .xml file, apply the algorithm to that file.
- If the tag contains a file with an extension other than .xml, copy the file to the resulting share directory.
Leave only used libraries
In this section you can find out which libraries are used in your app and remove the others.
ONNXRuntime
Used in:
- method12v*_recognizer
- SSYV
- ProcessingBlock API(except LIVENESS_ESTIMATOR without modification, QUALITY_ASSESSMENT_ESTIMATOR with modification)
CPU
- Linux
- libonnxruntime.so
- libonnxruntime_legacy.so(use_legacy = true)
- Windows
- onnxruntime.dll
- Android
- libonnxruntime.so
- iOS
- libonnxruntime.dylib
GPU
- Linux
- libonnxruntime_cuda.so
- libonnxruntime_providers_shared.so
- libonnxruntime_providers_cuda.so
- libonnxruntime_cuda_legacy.so(use_legacy = true)
- Windows
- onnxruntime_cuda.dll
- onnxruntime_providers_shared.dll
- onnxruntime_providers_cuda.dll
- onnxruntime_cuda_legacy.dll(use_legacy = true)
Tensorflow
Used in:
- method*v*_recognizer(except method12v*_recognizer)
- detectors(except SSYV)
- some blocks from Processing Block API(LIVENESS_ESTIMATOR without modification, QUALITY_ASSESSMENT_ESTIMATOR with modification)
GPU
- Linux
- libtensorflow.so.2
- tensorflow_avx2/libtensorflow.so.2(additional acceleration if AVX2 is supported)
- Windows
- tensorflow.dll
Mobile Devices
The libfacerec_jni.so library is not used in the Flutter API.