§
    Ý˜ºh3`  ã                   ó²  — d dl Z d dlZd dlZd dlZd dlmZmZmZmZ d dl	Z
ddlmZ ddlmZ ddlmZmZ ddlmZmZmZmZmZmZmZmZ ddlmZ  ed	d
¬¦  «        Z ej        e ¦  «        Z! G d„ de¦  «        Z G d„ d
e¦  «        Z" ee"j#        ¦  «        e"_#        e"j#        j$        �.e"j#        j$         %                    ddd¬¦  «        e"j#        _$        dS dS )é    N)ÚAnyÚOptionalÚTypeVarÚUnioné   )Úcustom_object_save)ÚBatchFeature)Úis_valid_imageÚ
load_image)ÚIMAGE_PROCESSOR_NAMEÚPROCESSOR_NAMEÚPushToHubMixinÚ	copy_funcÚdownload_urlÚis_offline_modeÚis_remote_urlÚlogging)Úcached_filesÚImageProcessorTypeÚImageProcessingMixin)Úboundc                   ó   — e Zd ZdZdS )r	   aþ  
    Holds the output of the image processor specific `__call__` methods.

    This class is derived from a python dictionary and can be used as a dictionary.

    Args:
        data (`dict`):
            Dictionary of lists/arrays/tensors returned by the __call__ method ('pixel_values', etc.).
        tensor_type (`Union[None, str, TensorType]`, *optional*):
            You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
            initialization.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    új/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/transformers/image_processing_base.pyr	   r	   0   s   € € € € € ðð ð ð r   r	   c                   óz  — e Zd ZdZdZd„ Zdefd„Ze	 	 	 	 	 d"de	e
         d	eeej        f         d
eeeej        f                  dededeeeef                  dede
fd„¦   «         Zd#deeej        f         defd„Zed	eeej        f         deeeef         eeef         f         fd„¦   «         Zedeeef         fd„¦   «         Zdeeef         fd„Zedeeej        f         fd„¦   «         Zdefd„Zdeeej        f         fd„Zd„ Zed$d„¦   «         Zd eeee         eee                  f         fd!„ZdS )%r   zˆ
    This is an image processor mixin used to provide saving/loading functionality for sequential and image feature
    extractors.
    Nc           
      ó.  — |                      dd¦  «         |                      dd¦  «        | _        |                     ¦   «         D ]N\  }}	 t          | ||¦  «         Œ# t          $ r*}t
                               d|› d|› d| › �¦  «         |‚d}~ww xY wdS )z'Set elements of `kwargs` as attributes.Úfeature_extractor_typeNÚprocessor_classz
Can't set z with value z for )ÚpopÚ_processor_classÚitemsÚsetattrÚAttributeErrorÚloggerÚerror)ÚselfÚkwargsÚkeyÚvalueÚerrs        r   Ú__init__zImageProcessingMixin.__init__H   s¾   € ð 	�
Š
Ð+¨TÑ2Ô2Ð2à &§
¢
Ð+<¸dÑ CÔ CˆÔà Ÿ,š,™.œ.ð 	ð 	‰JˆC�ðÝ˜˜c 5Ñ)Ô)Ð)Ð)øÝ!ð ð ð Ý—’ÐM¨#ÐMÐM¸5ÐMÐMÀtÐMÐMÑNÔNÐNØ�	øøøøðøøøð	ð 	s   ÁAÁ
BÁ(%BÂBr#   c                 ó   — || _         dS )z%Sets processor class as an attribute.N)r%   )r+   r#   s     r   Ú_set_processor_classz)ImageProcessingMixin._set_processor_classW   s   € à /ˆÔÐÐr   FÚmainÚclsÚpretrained_model_name_or_pathÚ	cache_dirÚforce_downloadÚlocal_files_onlyÚtokenÚrevisionÚreturnc                 ó   — ||d<   ||d<   ||d<   ||d<   |                      dd¦  «        }|�-t          j        dt          ¦  «         |�t	          d¦  «        ‚|}|�||d	<    | j        |fi |¤Ž\  }	} | j        |	fi |¤ŽS )
a¥  
        Instantiate a type of [`~image_processing_utils.ImageProcessingMixin`] from an image processor.

        Args:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                This can be either:

                - a string, the *model id* of a pretrained image_processor hosted inside a model repo on
                  huggingface.co.
                - a path to a *directory* containing a image processor file saved using the
                  [`~image_processing_utils.ImageProcessingMixin.save_pretrained`] method, e.g.,
                  `./my_model_directory/`.
                - a path or url to a saved image processor JSON *file*, e.g.,
                  `./my_model_directory/preprocessor_config.json`.
            cache_dir (`str` or `os.PathLike`, *optional*):
                Path to a directory in which a downloaded pretrained model image processor should be cached if the
                standard cache should not be used.
            force_download (`bool`, *optional*, defaults to `False`):
                Whether or not to force to (re-)download the image processor files and override the cached versions if
                they exist.
            resume_download:
                Deprecated and ignored. All downloads are now resumed by default when possible.
                Will be removed in v5 of Transformers.
            proxies (`dict[str, str]`, *optional*):
                A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
                'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
            token (`str` or `bool`, *optional*):
                The token to use as HTTP bearer authorization for remote files. If `True`, or not specified, will use
                the token generated when running `hf auth login` (stored in `~/.huggingface`).
            revision (`str`, *optional*, defaults to `"main"`):
                The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
                git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
                identifier allowed by git.


                <Tip>

                To test a pull request you made on the Hub, you can pass `revision="refs/pr/<pr_number>"`.

                </Tip>

            return_unused_kwargs (`bool`, *optional*, defaults to `False`):
                If `False`, then this function returns just the final image processor object. If `True`, then this
                functions returns a `Tuple(image_processor, unused_kwargs)` where *unused_kwargs* is a dictionary
                consisting of the key/value pairs whose keys are not image processor attributes: i.e., the part of
                `kwargs` which has not been used to update `image_processor` and is otherwise ignored.
            subfolder (`str`, *optional*, defaults to `""`):
                In case the relevant files are located inside a subfolder of the model repo on huggingface.co, you can
                specify the folder name here.
            kwargs (`dict[str, Any]`, *optional*):
                The values in kwargs of any keys which are image processor attributes will be used to override the
                loaded values. Behavior concerning key/value pairs whose keys are *not* image processor attributes is
                controlled by the `return_unused_kwargs` keyword parameter.

        Returns:
            A image processor of type [`~image_processing_utils.ImageProcessingMixin`].

        Examples:

        ```python
        # We can't instantiate directly the base class *ImageProcessingMixin* so let's show the examples on a
        # derived class: *CLIPImageProcessor*
        image_processor = CLIPImageProcessor.from_pretrained(
            "openai/clip-vit-base-patch32"
        )  # Download image_processing_config from huggingface.co and cache.
        image_processor = CLIPImageProcessor.from_pretrained(
            "./test/saved_model/"
        )  # E.g. image processor (or model) was saved using *save_pretrained('./test/saved_model/')*
        image_processor = CLIPImageProcessor.from_pretrained("./test/saved_model/preprocessor_config.json")
        image_processor = CLIPImageProcessor.from_pretrained(
            "openai/clip-vit-base-patch32", do_normalize=False, foo=False
        )
        assert image_processor.do_normalize is False
        image_processor, unused_kwargs = CLIPImageProcessor.from_pretrained(
            "openai/clip-vit-base-patch32", do_normalize=False, foo=False, return_unused_kwargs=True
        )
        assert image_processor.do_normalize is False
        assert unused_kwargs == {"foo": False}
        ```r6   r7   r8   r:   Úuse_auth_tokenNúrThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.úV`token` and `use_auth_token` are both specified. Please set only the argument `token`.r9   )r$   ÚwarningsÚwarnÚFutureWarningÚ
ValueErrorÚget_image_processor_dictÚ	from_dict)
r4   r5   r6   r7   r8   r9   r:   r,   r=   Úimage_processor_dicts
             r   Úfrom_pretrainedz$ImageProcessingMixin.from_pretrained[   sÖ   € ðt (ˆˆ{ÑØ#1ˆÐÑ Ø%5ˆÐ!Ñ"Ø%ˆˆzÑàŸšÐ$4°dÑ;Ô;ˆØÐ%ÝŒMð EÝñô ð ð Ð Ý Ølñô ð ð #ˆEàÐØ#ˆF�7‰Oà'C sÔ'CÐDaÐ'lÐ'lÐekÐ'lÐ'lÑ$Ð˜fàˆsŒ}Ð1Ð<Ð<°VÐ<Ð<Ð<r   Úsave_directoryÚpush_to_hubc           	      ó~  — |                      dd¦  «        }|�Ct          j        dt          ¦  «         |                     d¦  «        �t          d¦  «        ‚||d<   t          j                             |¦  «        rt          d|› d�¦  «        ‚t          j
        |d¬	¦  «         |rw|                      d
d¦  «        }|                      d|                     t          j        j        ¦  «        d         ¦  «        } | j        |fi |¤Ž}|                      |¦  «        }| j        �t!          | || ¬¦  «         t          j                             |t$          ¦  «        }|                      |¦  «         t(                               d|› �¦  «         |r-|                      |||||                     d¦  «        ¬¦  «         |gS )as  
        Save an image processor object to the directory `save_directory`, so that it can be re-loaded using the
        [`~image_processing_utils.ImageProcessingMixin.from_pretrained`] class method.

        Args:
            save_directory (`str` or `os.PathLike`):
                Directory where the image processor JSON file will be saved (will be created if it does not exist).
            push_to_hub (`bool`, *optional*, defaults to `False`):
                Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
                repository you want to push to with `repo_id` (will default to the name of `save_directory` in your
                namespace).
            kwargs (`dict[str, Any]`, *optional*):
                Additional key word arguments passed along to the [`~utils.PushToHubMixin.push_to_hub`] method.
        r=   Nr>   r9   r?   zProvided path (z#) should be a directory, not a fileT)Úexist_okÚcommit_messageÚrepo_idéÿÿÿÿ)ÚconfigzImage processor saved in )rL   r9   )r$   r@   rA   rB   ÚgetrC   ÚosÚpathÚisfileÚAssertionErrorÚmakedirsÚsplitÚsepÚ_create_repoÚ_get_files_timestampsÚ_auto_classr   Újoinr   Úto_json_filer)   ÚinfoÚ_upload_modified_files)	r+   rH   rI   r,   r=   rL   rM   Úfiles_timestampsÚoutput_image_processor_files	            r   Úsave_pretrainedz$ImageProcessingMixin.save_pretrainedÍ   sß  € ð  ŸšÐ$4°dÑ;Ô;ˆàÐ%ÝŒMð EÝñô ð ð �zŠz˜'Ñ"Ô"Ð.Ý Ølñô ð ð -ˆF�7‰OåŒ7�>Š>˜.Ñ)Ô)ð 	hÝ Ð!f°>Ð!fÐ!fÐ!fÑgÔgÐgå
Œ�N¨TÐ2Ñ2Ô2Ð2àð 	JØ#ŸZšZÐ(8¸$Ñ?Ô?ˆNØ—j’j ¨N×,@Ò,@ÅÄÄÑ,MÔ,MÈbÔ,QÑRÔRˆGØ'�dÔ'¨Ð:Ð:°6Ð:Ð:ˆGØ#×9Ò9¸.ÑIÔIÐð ÔÐ'Ý˜t ^¸DÐAÑAÔAÐAõ ')¤g§l¢l°>ÕCWÑ&XÔ&XÐ#à×ÒÐ5Ñ6Ô6Ð6Ý�ŠÐMÐ0KÐMÐMÑNÔNÐNàð 	Ø×'Ò'ØØØ Ø-Ø—j’j Ñ)Ô)ð (ñ ô ð ð ,Ð,Ð,r   c                 ó²  — |                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      d	d¦  «        }	|                      d
d¦  «        }
|                      dd¦  «        }|                      dt          ¦  «        }|                      dd¦  «        }|                      dd¦  «        }|�-t          j        dt          ¦  «         |�t          d¦  «        ‚|}d|dœ}|�||d<   t          ¦   «         r|	st                               d¦  «         d}	t          |¦  «        }t          j                             |¦  «        }t          j                             |¦  «        r t          j                             ||¦  «        }t          j                             |¦  «        r|}d}n€t          |¦  «        r|}t!          |¦  «        }n_|}	 t#          ||t$          g|||||	|||
|d¬¦  «        }|d         }n1# t&          $ r ‚ t(          $ r t'          d|› d|› d|› d�¦  «        ‚w xY w	 t+          |d¬¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   t/          j        |¦  «        }|                     d|¦  «        }n&# t.          j        $ r t'          d |› d!�¦  «        ‚w xY w|rt                               d"|› �¦  «         n t                               d"|› d#|› �¦  «         ||fS )$aÉ  
        From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a
        image processor of type [`~image_processor_utils.ImageProcessingMixin`] using `from_dict`.

        Parameters:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                The identifier of the pre-trained checkpoint from which we want the dictionary of parameters.
            subfolder (`str`, *optional*, defaults to `""`):
                In case the relevant files are located inside a subfolder of the model repo on huggingface.co, you can
                specify the folder name here.
            image_processor_filename (`str`, *optional*, defaults to `"config.json"`):
                The name of the file in the model directory to use for the image processor config.

        Returns:
            `tuple[Dict, Dict]`: The dictionary(ies) that will be used to instantiate the image processor object.
        r6   Nr7   FÚresume_downloadÚproxiesr9   r=   r8   r:   Ú	subfolderÚ Úimage_processor_filenameÚ_from_pipelineÚ
_from_autor>   r?   úimage processor)Ú	file_typeÚfrom_auto_classÚusing_pipelinez+Offline mode: forcing local_files_only=TrueT)Ú	filenamesr6   r7   rd   rc   r8   r9   Ú
user_agentr:   re   Ú%_raise_exceptions_for_missing_entriesr   z Can't load image processor for 'zœ'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'z2' is the correct path to a directory containing a z fileúutf-8©ÚencodingÚimage_processorz"It looks like the config file at 'z' is not a valid JSON file.zloading configuration file z from cache at )r$   r   r@   rA   rB   rC   r   r)   r]   ÚstrrQ   rR   Úisdirr[   rS   r   r   r   r   ÚOSErrorÚ	ExceptionÚopenÚreadÚjsonÚloadsrP   ÚJSONDecodeError)r4   r5   r,   r6   r7   rc   rd   r9   r=   r8   r:   re   rg   Úfrom_pipelinerl   ro   Úis_localÚimage_processor_fileÚresolved_image_processor_fileÚresolved_image_processor_filesÚreaderÚtextrF   s                          r   rD   z-ImageProcessingMixin.get_image_processor_dict
  sB  € ð( —J’J˜{¨DÑ1Ô1ˆ	ØŸšÐ$4°eÑ<Ô<ˆØ Ÿ*š*Ð%6¸Ñ=Ô=ˆØ—*’*˜Y¨Ñ-Ô-ˆØ—
’
˜7 DÑ)Ô)ˆØŸšÐ$4°dÑ;Ô;ˆØ!Ÿ:š:Ð&8¸%Ñ@Ô@ÐØ—:’:˜j¨$Ñ/Ô/ˆØ—J’J˜{¨BÑ/Ô/ˆ	Ø#)§:¢:Ð.HÕJ^Ñ#_Ô#_Ð àŸ
š
Ð#3°TÑ:Ô:ˆØ Ÿ*š* \°5Ñ9Ô9ˆàÐ%ÝŒMð EÝñô ð ð Ð Ý Ølñô ð ð #ˆEà#4ÈÐYÐYˆ
ØÐ$Ø+8ˆJÐ'Ñ(åÑÔð 	$Ð%5ð 	$Ý�KŠKÐEÑFÔFÐFØ#Ðå(+Ð,IÑ(JÔ(JÐ%Ý”7—=’=Ð!>Ñ?Ô?ˆÝŒ7�=Š=Ð6Ñ7Ô7ð 	iÝ#%¤7§<¢<Ð0MÐOgÑ#hÔ#hÐ ÝŒ7�>Š>Ð7Ñ8Ô8ð $	Ø,IÐ)ØˆHˆHÝÐ8Ñ9Ô9ð !	Ø#@Ð Ý,8Ð9VÑ,WÔ,WÐ)Ð)à#;Ð ðå1=Ø1Ø3µ^ÐDØ'Ø#1Ø#Ø$3Ø%5ØØ)Ø%Ø'Ø:?ð2ñ 2ô 2Ð.ð 1OÈqÔ0QÐ-Ð-øÝð ð ð ð Ýð ð ð åðOÐ7Tð Oð Oà9VðOð Oð 0HðOð Oð Oñô ð ðøøøð
	åÐ3¸gÐFÑFÔFð %È&Ø—{’{‘}”}�ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %å#'¤:¨dÑ#3Ô#3Ð Ø#7×#;Ò#;Ð<MÐOcÑ#dÔ#dÐ Ð øåÔ#ð 	ð 	ð 	ÝØoÐ5RÐoÐoÐoñô ð ð	øøøð
 ð 	Ý�KŠKÐUÐ6SÐUÐUÑVÔVÐVÐVå�KŠKØrÐ.BÐrÐrÐSpÐrÐrñô ð ð $ VÐ+Ð+s<   È**I É.JÊK/ ÊJ9Ê-K/ Ê9J=Ê=K/ Ë J=Ë-K/ Ë/#LrF   c                 ó
  — |                      ¦   «         }|                     dd¦  «        }d|v rd|v r|                     d¦  «        |d<   d|v rd|v r|                     d¦  «        |d<    | di |¤Ž}g }|                     ¦   «         D ];\  }}t          ||¦  «        r&t	          |||¦  «         |                     |¦  «         Œ<|D ]}|                     |d¦  «         Œt                               d|› �¦  «         |r||fS |S )aí  
        Instantiates a type of [`~image_processing_utils.ImageProcessingMixin`] from a Python dictionary of parameters.

        Args:
            image_processor_dict (`dict[str, Any]`):
                Dictionary that will be used to instantiate the image processor object. Such a dictionary can be
                retrieved from a pretrained checkpoint by leveraging the
                [`~image_processing_utils.ImageProcessingMixin.to_dict`] method.
            kwargs (`dict[str, Any]`):
                Additional parameters from which to initialize the image processor object.

        Returns:
            [`~image_processing_utils.ImageProcessingMixin`]: The image processor object instantiated from those
            parameters.
        Úreturn_unused_kwargsFÚsizeÚ	crop_sizeNzImage processor r   )Úcopyr$   r&   Úhasattrr'   Úappendr)   r]   )r4   rF   r,   r†   rt   Ú	to_remover-   r.   s           r   rE   zImageProcessingMixin.from_dict~  sR  € ð"  4×8Ò8Ñ:Ô:ÐØ%ŸzšzÐ*@À%ÑHÔHÐð
 �VÐÐ Ð*>Ð >Ð >Ø+1¯:ª:°fÑ+=Ô+=Ð  Ñ(Ø˜&Ð Ð  [Ð4HÐ%HÐ%HØ06·
²
¸;Ñ0GÔ0GÐ  Ñ-à˜#Ð5Ð5Ð 4Ð5Ð5ˆð ˆ	Ø Ÿ,š,™.œ.ð 	&ð 	&‰JˆC�Ý�¨Ñ,Ô,ð &Ý˜¨¨eÑ4Ô4Ð4Ø× Ò  Ñ%Ô%Ð%øØð 	"ð 	"ˆCØ�JŠJ�s˜DÑ!Ô!Ð!Ð!å�ŠÐ8 Ð8Ð8Ñ9Ô9Ð9Øð 	#Ø" FÐ*Ð*à"Ð"r   c                 óV   — t          j        | j        ¦  «        }| j        j        |d<   |S )z¿
        Serializes this instance to a Python dictionary.

        Returns:
            `dict[str, Any]`: Dictionary of all the attributes that make up this image processor instance.
        Úimage_processor_type)r‰   ÚdeepcopyÚ__dict__Ú	__class__r   )r+   Úoutputs     r   Úto_dictzImageProcessingMixin.to_dict«  s*   € õ ”˜tœ}Ñ-Ô-ˆØ)-¬Ô)@ˆÐ%Ñ&àˆr   Ú	json_filec                 ó´   — t          |d¬¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   t          j        |¦  «        } | di |¤ŽS )aÐ  
        Instantiates a image processor of type [`~image_processing_utils.ImageProcessingMixin`] from the path to a JSON
        file of parameters.

        Args:
            json_file (`str` or `os.PathLike`):
                Path to the JSON file containing the parameters.

        Returns:
            A image processor of type [`~image_processing_utils.ImageProcessingMixin`]: The image_processor object
            instantiated from that JSON file.
        rq   rr   Nr   )ry   rz   r{   r|   )r4   r”   rƒ   r„   rF   s        r   Úfrom_json_filez#ImageProcessingMixin.from_json_file·  s�   € õ �) gÐ.Ñ.Ô.ð 	!°&Ø—;’;‘=”=ˆDð	!ð 	!ð 	!ñ 	!ô 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!øøøð 	!ð 	!ð 	!ð 	!å#œz¨$Ñ/Ô/ÐØˆsÐ*Ð*Ð)Ð*Ð*Ð*s   ’3³7º7c                 ó.  — |                       ¦   «         }|                     ¦   «         D ]6\  }}t          |t          j        ¦  «        r|                     ¦   «         ||<   Œ7|                     dd¦  «        }|�||d<   t          j        |dd¬¦  «        dz   S )zÃ
        Serializes this instance to a JSON string.

        Returns:
            `str`: String containing all the attributes that make up this feature_extractor instance in JSON format.
        r%   Nr#   é   T)ÚindentÚ	sort_keysú
)	r“   r&   Ú
isinstanceÚnpÚndarrayÚtolistr$   r{   Údumps)r+   Ú
dictionaryr-   r.   r%   s        r   Úto_json_stringz#ImageProcessingMixin.to_json_stringÊ  sš   € ð —\’\‘^”^ˆ
à$×*Ò*Ñ,Ô,ð 	1ð 	1‰JˆC�Ý˜%¥¤Ñ,Ô,ð 1Ø"'§,¢,¡.¤.�
˜3‘øð &Ÿ>š>Ð*<¸dÑCÔCÐØÐ'Ø,<ˆJÐ(Ñ)åŒz˜*¨Q¸$Ð?Ñ?Ô?À$ÑFÐFr   Újson_file_pathc                 óª   — t          |dd¬¦  «        5 }|                     |                      ¦   «         ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zá
        Save this instance to a JSON file.

        Args:
            json_file_path (`str` or `os.PathLike`):
                Path to the JSON file in which this image_processor instance's parameters will be saved.
        Úwrq   rr   N)ry   Úwriter¢   )r+   r£   Úwriters      r   r\   z!ImageProcessingMixin.to_json_fileß  s˜   € õ �. #°Ð8Ñ8Ô8ð 	0¸FØ�LŠL˜×,Ò,Ñ.Ô.Ñ/Ô/Ð/ð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0øøøð 	0ð 	0ð 	0ð 	0ð 	0ð 	0s   “(AÁAÁAc                 óH   — | j         j        › d|                      ¦   «         › �S )Nú )r‘   r   r¢   )r+   s    r   Ú__repr__zImageProcessingMixin.__repr__ê  s'   € Ø”.Ô)ÐCÐC¨D×,?Ò,?Ñ,AÔ,AÐCÐCÐCr   ÚAutoImageProcessorc                 ó¢   — t          |t          ¦  «        s|j        }ddlmc m} t          ||¦  «        st          |› d�¦  «        ‚|| _        dS )a{  
        Register this class with a given auto class. This should only be used for custom image processors as the ones
        in the library are already mapped with `AutoImageProcessor `.



        Args:
            auto_class (`str` or `type`, *optional*, defaults to `"AutoImageProcessor "`):
                The auto class to register this new image processor with.
        r   Nz is not a valid auto class.)	rœ   ru   r   Útransformers.models.autoÚmodelsÚautorŠ   rC   rZ   )r4   Ú
auto_classÚauto_modules      r   Úregister_for_auto_classz,ImageProcessingMixin.register_for_auto_classí  sn   € õ ˜*¥cÑ*Ô*ð 	-Ø#Ô,ˆJà6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6å�{ JÑ/Ô/ð 	IÝ 
ÐGÐGÐGÑHÔHÐHà$ˆŒˆˆr   Úimage_url_or_urlsc                 óò   ‡ — t          |t          ¦  «        rˆ fd„|D ¦   «         S t          |t          ¦  «        rt          |¦  «        S t	          |¦  «        r|S t          dt          |¦  «        › �¦  «        ‚)zé
        Convert a single or a list of urls into the corresponding `PIL.Image` objects.

        If a single url is passed, the return value will be a single object. If a list is passed a list of objects is
        returned.
        c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r   )Úfetch_images)Ú.0Úxr+   s     €r   ú
<listcomp>z5ImageProcessingMixin.fetch_images.<locals>.<listcomp>  s'   ø€ ÐDÐDÐD¨Q�D×%Ò% aÑ(Ô(ÐDÐDÐDr   z=only a single or a list of entries is supported but got type=)rœ   Úlistru   r   r
   Ú	TypeErrorÚtype)r+   r³   s   ` r   r¶   z!ImageProcessingMixin.fetch_images  s�   ø€ õ Ð'­Ñ.Ô.ð 	wØDÐDÐDÐDÐ2CÐDÑDÔDÐDÝÐ)­3Ñ/Ô/ð 	wÝÐ/Ñ0Ô0Ð0ÝÐ-Ñ.Ô.ð 	wØ$Ð$åÐuÕ\`ÐarÑ\sÔ\sÐuÐuÑvÔvÐvr   )NFFNr3   )F)r«   )r   r   r   r   rZ   r0   ru   r2   Úclassmethodr¼   r   r   rQ   ÚPathLiker   ÚboolrG   ra   ÚtupleÚdictr   rD   rE   r“   r–   r¢   r\   rª   r²   rº   r¶   r   r   r   r   r   @   sÛ  € € € € € ðð ð
 €Kðð ð ð0°Cð 0ð 0ð 0ð 0ð ð 8<Ø$Ø!&Ø,0Øðo=ð o=ØÐ$Ô%ðo=à',¨S°"´+Ð-=Ô'>ðo=ð ˜E # r¤{Ð"2Ô3Ô4ðo=ð ð	o=ð
 ðo=ð ˜˜c 4˜iÔ(Ô)ðo=ð ðo=ð 
ðo=ð o=ð o=ñ „[ðo=ðb;-ð ;-¨e°C¸¼Ð4DÔ.Eð ;-ÐTXð ;-ð ;-ð ;-ð ;-ðz ðq,Ø,1°#°r´{Ð2BÔ,Cðq,à	ˆt�C˜�HŒ~˜t C¨ Hœ~Ð-Ô	.ðq,ð q,ð q,ñ „[ðq,ðf ð*#¨T°#°s°(¬^ð *#ð *#ð *#ñ „[ð*#ðX
˜˜c 3˜hœð 
ð 
ð 
ð 
ð ð+ u¨S°"´+Ð-=Ô'>ð +ð +ð +ñ „[ð+ð$G ð Gð Gð Gð Gð*	0¨5°°b´kÐ1AÔ+Bð 	0ð 	0ð 	0ð 	0ðDð Dð Dð ð%ð %ð %ñ „[ð%ð*w¨e°C¸¸c¼ÀDÈÈcÌÄOÐ4SÔ.Tð wð wð wð wð wð wr   rj   r«   zimage processor file)ÚobjectÚobject_classÚobject_files)&r‰   r{   rQ   r@   Útypingr   r   r   r   Únumpyr�   Údynamic_module_utilsr   Úfeature_extraction_utilsr	   ÚBaseBatchFeatureÚimage_utilsr
   r   Úutilsr   r   r   r   r   r   r   r   Ú	utils.hubr   r   Ú
get_loggerr   r)   r   rI   r   Úformatr   r   r   ú<module>rÏ      s  ðð  €€€Ø €€€Ø 	€	€	€	Ø €€€Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à Ð Ð Ð à 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø FÐ FÐ FÐ FÐ FÐ FØ 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð $Ð #Ð #Ð #Ð #Ð #ð �WÐ1Ð9OÐPÑPÔPÐ ð 
ˆÔ	˜HÑ	%Ô	%€ð
ð ð ð ð Ð#ñ ô ð ð Qwð Qwð Qwð Qwð Qw˜>ñ Qwô Qwð Qwðh $- 9Ð-AÔ-MÑ#NÔ#NÐ Ô  ØÔ#Ô+Ð7Ø/CÔ/OÔ/W×/^Ò/^Ø Ð/CÐRhð 0_ñ 0ô 0ÐÔ$Ô,Ð,Ð,ð 8Ð7r   