.. index:: 
  !FaceLibrary.loadModelBuffer Method
  
.. _id3_face_face_library_load_model_buffer_class_method:

===============================================================================
FaceLibrary.loadModelBuffer Method
===============================================================================

Module: :ref:`FaceLibrary<id3_face_face_library_class>`

Definition
----------

Loads a model into memory from the specified buffer.


.. tab-set::

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

      .. code:: Python

        @staticmethod
        load_model_buffer(model_buffer: bytearray, face_model: FaceModel, processing_unit: ProcessingUnit) -> None

      **Parameters**

        .. line-block::

          ``model_buffer`` bytearray
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``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 loadModelBuffer(Uint8List? modelBuffer, FaceModel faceModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` Uint8List
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``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 LoadModelBuffer(byte[] modelBuffer, FaceModel faceModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` byte[]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``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 loadModelBuffer(byte[] modelBuffer, FaceModel faceModel, ProcessingUnit processingUnit) throws FaceException

      **Parameters**

        .. line-block::

          ``modelBuffer`` byte[]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``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 loadModelBuffer(modelBuffer: [UInt8], faceModel: FaceModel, processingUnit: ProcessingUnit) throws

      **Parameters**

        .. line-block::

          ``modelBuffer`` [UInt8]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``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_LoadModelBuffer (
            unsigned char * modelBuffer, 
            int modelBufferSize, 
            id3FaceModel eFaceModel, 
            id3FaceProcessingUnit eProcessingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` unsigned char *
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``modelBufferSize`` int
          :guilabel:`in` Size of the 'modelBuffer' buffer.

          ``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.


