ClassifyDescriptor

Classify a given descriptor based on the label of its k-nearest neighbors for a given DescriptorSet.

A blob must be provided in the array of blobs, which contains the query descriptor’s values. The blob is an binary array of 32-bit floating point values. The size of the blob, in bytes, must be dimensions*4.

Parameters

  • set: Name of the set.
  • k_neighbors: Specifies the number of nearest neighbors that will be used to assign a label to the given descriptor

Details

This command will “classify” a descriptor, i.e. assign a “label” to it, based on its k_neighbors nearest neighbors, and using the specified label when the descriptors were inserted. Check AddDescriptor for more details on how a “label” is assigned to a descriptor.

Examples

Classify a given descriptor using the labels of its 10 nearest neighbors:

[ {
    {
        "ClassifyDescriptor": {
            "set": "party_faces",
            "k_closest": 10
        }
    }
}]

# A blob must be passed together with the JSON Query.
# The blobs is an array of 32-bit floating point values.