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:
OS | .plan files |
---|---|
LUNA ID for Android | cnn52m_cpu.plan cnn52m_arm.plan cnn59m_arm.plan cnn59m_cpu.plan |
LUNA ID for iOS | cnn52m_arm.plan cnn59m_arm.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:
Package | .plan files |
---|---|
ai.visionlabs.lunaid:cnn59:X.X.X | cnn59m_arm.plan cnn59m_cpu.plan |
ai.visionlabs.lunaid:cnn52:X.X.X | cnn52m_arm.plan cnn52m_cpu.plan |
To get a descriptor, call a method of the LunaUtils
class. For example:
public fun getDescriptorFromWrapped(
warp: Bitmap,
@DescriptorVersion descriptorVersion: Int = V59
): ByteArray {
}
public fun getDescriptor(
image: Bitmap,
@DescriptorVersion descriptorVersion: Int = V59
): ByteArray {
}
public fun matchDescriptors(
first: ByteArray,
second: ByteArray,
@DescriptorVersion descriptorVersion: Int = V59
): Float {
}
All the methods take descriptorVersion
as an argument. The argument has two possible values: V59
(default) and V52
. The values specify the model version to be used. We recommend that you use V59
.
In LUNA ID for iOS#
To calculate descriptors, LUNA ID for iOS uses the cnn59m_arm.plan file by default. The .plan file and its version are defined in the fsdk.framework/data/faceengine.conf file:
<param name="model" type="Value::Int1" x="59" />
If you need to use the cnn52m_arm.plan file, change the fsdk.framework/data/faceengine.conf file as follows:
<param name="model" type="Value::Int1" x="52" />