# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Loader
"""

__all__ = ["Loader"]


from sklearn.base import TransformerMixin

from ...base_transform import BaseTransform
from ...internal.core.feature_extraction.image.loader import Loader as core
from ...internal.utils.utils import trace


class Loader(core, BaseTransform, TransformerMixin):
    """

    Loaders image data.

    .. remarks::
        ``Loader`` loads images from paths.

    :param columns: a dictionary of key-value pairs, where key is the output
        column name and value is the input column name.

        * Multiple key-value pairs are allowed.
        * Input column type: string.
        * Output column type: :ref:`Picture`.
        * If the output column names are same as the input column names, then
        simply specify ``columns`` as a list of strings.

        The << operator can be used to set this value (see
        `Column Operator </nimbusml/concepts/columns>`_)

        For example
         * Loader(columns={'out1':'input1', 'out2':'input2'})
         * Loader() << {'out1':'input1', 'out2':'input2'}

        For more details see `Columns </nimbusml/concepts/columns>`_.

    :param image_folder: Folder where to search for images.

    :param params: Additional arguments sent to compute engine.

    .. seealso::
        :py:class:`Resizer <nimbusml.feature_extraction.image.Resizer>`,
        :py:class:`PixelExtractor
        <nimbusml.feature_extraction.image.PixelExtractor>`.

    .. index:: transform, image

    Example:
       .. literalinclude:: /../nimbusml/examples/Image.py
              :language: python
    """

    @trace
    def __init__(
            self,
            image_folder=None,
            columns=None,
            **params):

        if columns:
            params['columns'] = columns
        BaseTransform.__init__(self, **params)
        core.__init__(
            self,
            image_folder=image_folder,
            **params)
        self._columns = columns

    def get_params(self, deep=False):
        """
        Get the parameters for this operator.
        """
        return core.get_params(self)
