Skip to main content

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_neighbors": 10
}
}]

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

Example response:


[{
"ClassifyDescriptor": {
"entities": [{
"_uniqueid": "10.11.58280"
}, {
"_uniqueid": "10.3.58120"
}, {
"_uniqueid": "10.9.58240"
}, {
"_uniqueid": "10.12.58300"
}, {
"_uniqueid": "10.15.58360"
}, {
"_uniqueid": "10.1.58080"
}, {
"_uniqueid": "10.4.58140"
}, {
"_uniqueid": "10.7.58200"
}, {
"_uniqueid": "10.10.58260"
}, {
"_uniqueid": "10.13.58320"
}],
"label": "bar",
"returned": 10,
"status": 0
}
}]