.. _AddDescriptor: AddDescriptor ============= Insert a descriptor in an explicit ``class``. Requires ``objects.create`` permission and one input blob: a nonempty, unpadded array of finite IEEE 754 float32 values in the server's native byte order (normally little-endian). An active vector definition additionally enforces its dimensions. A descriptor class can exist without an index; a definition created later validates and populates its existing values atomically. See :doc:`../DescriptorIndexes`. Parameters ---------- ``class`` is required. Optional fields are ``_ref``, ``properties``, ``label``, ``if_not_found`` and ``connect``. The default label is the string ``"None"``. Conditional insertion searches the exact descriptor class. Every customer connection in ``connect`` requires a class. .. include:: add_details.rst Success returns ``status: 0``. A conditional match returns status 2, skips insertion and retains the matches in ``_ref`` when requested. Invalid dimensions, nonfinite values or invalid references fail the transaction. Examples -------- Create a class's vector index, then add one vector using its corresponding input blob: .. TESTED_EXAMPLE: AddDescriptor_1 .. code-block:: json [{ "CreateIndex": { "target": "descriptor", "class": "Faces", "property": "_blob", "kind": "flat", "params": { "dimensions": 3 } } }, { "AddDescriptor": { "class": "Faces", "label": "Alice", "properties": { "confidence": 0.9 } } }] In Python, the blob can be produced with ``np.asarray([1,2,3], dtype="