Skip to content

Using descriptors#

Descriptors are data sets in closed, binary format prepared by recognition system based on the characteristic being analyzed.

LUNA ID uses .plan files that stores a compact set of packed properties, as well as some helper parameters used to extract these properties from the source image. The .plan files are:

.plan file OS
cnn59m_arm.plan
cnn59m_cpu.plan
cnn60m_arm.plan
cnn60m_cpu.plan

Using the .plan files to generate descriptors will increase the size of your app. To learn how to measure the size added to your app, see Measure LUNA ID size.

In LUNA ID for Android#

Descriptor functions are available in the following packages:

  • ai.visionlabs.lunaid:cnn59:X.X.X
  • ai.visionlabs.lunaid:cnn60:X.X.X

To get a descriptor, call a method of the LunaUtils class. For example:

    public fun getDescriptorFromWrapped(
        warp: Bitmap,
        @DescriptorVersion descriptorVersion: Int = V60
    ): ByteArray {
    }
    public fun getDescriptor(
        image: Bitmap,
        @DescriptorVersion descriptorVersion: Int = V60
    ): ByteArray {
    }
    public fun matchDescriptors(
        first: ByteArray,
        second: ByteArray,
        @DescriptorVersion descriptorVersion: Int = V60
    ): Float {
    }

All the methods take descriptorVersion as an argument. The argument has two possible values: V60 (default) and V59. The values specify the model version to be used. We recommend that you use V60.

In LUNA ID for iOS#

To calculate descriptors, LUNA ID for iOS uses the cnn60m_arm.plan file.