.. index:: 
  !FaceIndexer.searchTemplate Method
  
.. _id3_face_face_indexer_search_template_class_method:

===============================================================================
FaceIndexer.searchTemplate Method
===============================================================================

Module: :ref:`FaceIndexer<id3_face_face_indexer_class>`

Definition
----------

Performs a one-to-many search of a face template probe against a previously initialized face indexer and outputs a candidate list.

This function is thread safe with other SearchTemplate() calls but not with AddTemplate() calls.


.. tab-set::

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

      .. code:: Python

        search_template(self, probe: FaceTemplate, max_candidates: int) -> FaceCandidateList

      **Parameters**

        .. line-block::

          ``probe`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``max_candidates`` int
          :guilabel:`in` Maximum number of candidates in the candidate list.


      **Returns**

        .. line-block::

          :ref:`FaceCandidateList<id3_face_face_candidate_list_class>`
          The list of candidates sorted by decreasing match score.

      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

        FaceCandidateList searchTemplate(FaceTemplate probe, int maxCandidates)

      **Parameters**

        .. line-block::

          ``probe`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``maxCandidates`` int
          :guilabel:`in` Maximum number of candidates in the candidate list.


      **Returns**

        .. line-block::

          :ref:`FaceCandidateList<id3_face_face_candidate_list_class>`
          The list of candidates sorted by decreasing match score.

      **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 FaceCandidateList SearchTemplate(FaceTemplate probe, int maxCandidates)

      **Parameters**

        .. line-block::

          ``probe`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``maxCandidates`` int
          :guilabel:`in` Maximum number of candidates in the candidate list.


      **Returns**

        .. line-block::

          :ref:`FaceCandidateList<id3_face_face_candidate_list_class>`
          The list of candidates sorted by decreasing match score.

      **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 FaceCandidateList searchTemplate(FaceTemplate probe, int maxCandidates) throws FaceException

      **Parameters**

        .. line-block::

          ``probe`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``maxCandidates`` int
          :guilabel:`in` Maximum number of candidates in the candidate list.


      **Returns**

        .. line-block::

          :ref:`FaceCandidateList<id3_face_face_candidate_list_class>`
          The list of candidates sorted by decreasing match score.

      **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 searchTemplate(probe: FaceTemplate, maxCandidates: Int32) throws -> FaceCandidateList

      **Parameters**

        .. line-block::

          ``probe`` :ref:`FaceTemplate<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``maxCandidates`` Int32
          :guilabel:`in` Maximum number of candidates in the candidate list.


      **Returns**

        .. line-block::

          :ref:`FaceCandidateList<id3_face_face_candidate_list_class>`
          The list of candidates sorted by decreasing match score.

      **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_SearchTemplate (
            ID3_FACE_INDEXER hFaceIndexer, 
            ID3_FACE_TEMPLATE hProbe, 
            int maxCandidates, 
            ID3_FACE_CANDIDATE_LIST hCandidates)

      **Parameters**

        .. line-block::

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

          ``hProbe`` :ref:`ID3_FACE_TEMPLATE<id3_face_face_template_class>`
          :guilabel:`in` The face template probe.

          ``maxCandidates`` int
          :guilabel:`in` Maximum number of candidates in the candidate list.

          ``hCandidates`` :ref:`ID3_FACE_CANDIDATE_LIST<id3_face_face_candidate_list_class>`
          :guilabel:`out` The list of candidates sorted by decreasing match score.


      **Returns**

        .. line-block::

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


