Skip to content

Reducing your app size by excluding .plan files#

LUNA ID uses neural networks for face processing in images and video streams. Neural networks are stored in the .plan files. You can reduce the size of your app by removing unnecessary .plan files.

In LUNA ID for Android#

To remove unnecessary .plan files, specify the .plan files to be excluded as shown in the examples below:

  • In the build.gradle.kts file:
    android {
        ...

        androidResources {
            ignoreAssetsPatterns.addAll(
                listOf(
                    "!glasses_estimation_flwr_arm.plan",
                    "!glasses_estimation_flwr_cpu.plan",
                    "!mask_clf_v3_arm.plan",
                    "!mask_clf_v3_cpu.plan",
                    "!oslm_v4_model_1_arm.plan",
                    "!oslm_v4_model_1_cpu.plan",
                    "!oslm_v4_model_2_arm.plan",
                    "!oslm_v4_model_2_cpu.plan",
                    "!cnn59m_arm.plan",
                    "!cnn59m_cpu.plan",
                    "!cnndescriptor_59.conf",
                )
            )
        }

            ...
        }
  • In the build.dragle file:
    android {
        ...

        androidResources {
            ignoreAssetsPatterns.addAll(
                    [
                            "!glasses_estimation_flwr_arm.plan",
                            "!glasses_estimation_flwr_cpu.plan",
                            "!mask_clf_v3_arm.plan",
                            "!mask_clf_v3_cpu.plan",
                            "!oslm_v4_model_1_arm.plan",
                            "!oslm_v4_model_1_cpu.plan",
                            "!oslm_v4_model_2_arm.plan",
                            "!oslm_v4_model_2_cpu.plan",
                            "!cnn59m_arm.plan",
                            "!cnn59m_cpu.plan",
                            "!cnndescriptor_59.conf",
                    ]
            )
        }

            ...
        }

If you use AGP v. 7.1 or earlier, replace androidResources with AaptOptions.

In LUNA ID for iOS#

To reduce your app size, remove unnecessary .plan files from the sdk' directory.framework/ios_arm64(or simulator)/fsdk.framework/data/ directory. The .plan files that you can remove are:

  • glasses_estimation_flwr_arm.plan
  • mask_clf_v3_arm.plan
  • oslm_v4_model_1_arm.plan
  • oslm_v4_model_2_arm.plan
  • cnn59m_arm.plan