.. index:: 
  !FaceLibrary.loadModel Method
  
.. _id3_face_face_library_load_model_class_method:

===============================================================================
FaceLibrary.loadModel Method
===============================================================================

Module: :ref:`FaceLibrary<id3_face_face_library_class>`

Definition
----------

Loads a specified AI model into memory from the specified directory.


.. tab-set::

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

      .. code:: Python

        @staticmethod
        load_model(model_path: str, face_model: FaceModel, processing_unit: ProcessingUnit) -> None

      **Parameters**

        .. line-block::

          ``model_path`` str
          :guilabel:`in` The path to directory containing the AI model files.

          ``face_model`` :ref:`FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processing_unit`` :ref:`ProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

        static void loadModel(String? modelPath, FaceModel faceModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``faceModel`` :ref:`FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **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 static void LoadModel(string modelPath, FaceModel faceModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` string
          :guilabel:`in` The path to directory containing the AI model files.

          ``faceModel`` :ref:`FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **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 static void loadModel(String modelPath, FaceModel faceModel, ProcessingUnit processingUnit) throws FaceException

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``faceModel`` :ref:`FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **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 static func loadModel(modelPath: String, faceModel: FaceModel, processingUnit: ProcessingUnit) throws

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``faceModel`` :ref:`FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **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 id3FaceLibrary_LoadModel (
            const char * modelPath, 
            id3FaceModel eFaceModel, 
            id3FaceProcessingUnit eProcessingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` const char *
          :guilabel:`in` The path to directory containing the AI model files.

          ``eFaceModel`` :ref:`id3FaceModel<id3_face_face_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``eProcessingUnit`` :ref:`id3FaceProcessingUnit<id3_face_processing_unit_enum>`
          :guilabel:`in` The processing unit to be used.


      **Returns**

        .. line-block::

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


