.. index:: 
  !FaceIndexer.addTemplate Method
  
.. _id3_face_face_indexer_add_template_class_method:

===============================================================================
FaceIndexer.addTemplate Method
===============================================================================

Module: :ref:`FaceIndexer<id3_face_face_indexer_class>`

Definition
----------

Adds a template to the Face Indexer.

.. note:: This function is thread safe with other AddTemplate() calls but not with SearchTemplates() calls.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        add_template(self, face_template: FaceTemplate, id: str) -> None

      **Parameters**

        .. line-block::

          ``face_template`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` str
          :guilabel:`in` ID of the added face template.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        void addTemplate(FaceTemplate faceTemplate, String? id)

      **Parameters**

        .. line-block::

          ``faceTemplate`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` String
          :guilabel:`in` ID of the added face template.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public void AddTemplate(FaceTemplate faceTemplate, string id)

      **Parameters**

        .. line-block::

          ``faceTemplate`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` string
          :guilabel:`in` ID of the added face template.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public void addTemplate(FaceTemplate faceTemplate, String id) throws FaceException

      **Parameters**

        .. line-block::

          ``faceTemplate`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` String
          :guilabel:`in` ID of the added face template.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func addTemplate(faceTemplate: FaceTemplate, id: String) throws

      **Parameters**

        .. line-block::

          ``faceTemplate`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` String
          :guilabel:`in` ID of the added face template.


      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceIndexer_AddTemplate (
            ID3_FACE_INDEXER hFaceIndexer, 
            ID3_FACE_TEMPLATE hFaceTemplate, 
            const char * id)

      **Parameters**

        .. line-block::

          ``hFaceIndexer`` :ref:`ID3_FACE_INDEXER<id3_face_face_indexer_class>`
          :guilabel:`in` Handle to the FaceIndexer object.

          ``hFaceTemplate`` :ref:`ID3_FACE_TEMPLATE<id3_face_face_template_class>`
          :guilabel:`in` Face template to add to the face indexer.

          ``id`` const char *
          :guilabel:`in` ID of the added face template.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


