ó
    pyüiu”  ã                   ó  • % S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSK	J
r
Jr  SSKJr  SS	KJrJrJrJrJrJrJrJrJr  SS
KJr  SSKJr  SSKJr  SSKJrJ r J!r!J"r"  \RF                  " \$5      r%/ SQr&\(       a  \" 5       r\\'\(\'\'S-  4   4   \)S'   GOR\" / SSSS.4PSSSS.4PSSSS.4PSSSS.4PSSSS.4PSSSS.4PS S!S"S.4PS#S$S%S.4PS&S'S(S.4PS)S*S+S.4PS,S*S+S.4PS-S.S/S.4PS0S1S2S.4PS3S4S5S.4PS6S!S"S.4PS7S8S9S.4PS:S;S<S.4PS=S>S?04PS@SASB04PSCSDSES.4PSFS'S(S.4PSGSSS.4PSHS8S9S.4PSIS$S%S.4PSJSSS.4PSKSLSMS.4PSNSSS.4PSOS8S9S.4PSPS!S"S.4PSQSSS.4PSRSSS.4PSSSSS.4PSTSUSVS.4PSWSXSYS.4PSZS[S\S.4PS]SLSMS.4PS^S_S`S.4PSaSSS.4PSbS!S"S.4PScS[S\S.4PSdSSS.4PSeSfSgS.4PShSiSjS.4PSkSlSmS.4PSnS$S%S.4PSoS8S9S.4PSpS>Sq04PSrS>Ss04PStSuSvS.4PSwSSS.4PSxS'S(S.4PSyS'S(S.4PSzS'S(S.4PS{S'S(S.4PS|S'S(S.4PS}S'S(S.4PS~S*S+S.4PSS*S+S.4PS€S>S?04PS�S>S‚04PSƒS>S‚04PS„S>S‚04PS…S>S‚04PS†S‡SˆS.4PS‰SŠS‹S.4PSŒS>S�04PSŽS!S"S.4PS�S!S"S.4PS�S!S"S.4PS‘SŠS‹S.4PS’SŠS‹S.4PS“SlSmS.4PS”S•S–S—.4PS˜SAS™04PSšS!S"S.4PS›SœS�S.4PSžSŸS S.4PS¡SAS¢04PS£SSS.4PS¤S!S"S.4PS¥S!S"S.4PS¦S>S§04PS¨SSS.4P5      r*\RV                  " \*5        \" \\5      r,S©\'4Sª jr-      SÁS«\'\R\                  -  S¬\'\R\                  -  S-  S­\/S®\(\'\'4   S-  S¯\/\'-  S-  S°\'S-  S±\/4S² jjr0S³\'S-  S´\/S-  Sµ\'S-  S¶\'4S· jr1S¸ r2Sµ\'S¶\(S-  4S¹ jr3SÂSº jr4S» r5\" S¼S½9 " S¾ S¿5      5       r6SÀS¿/r7g)ÃzAutoImageProcessor class.é    N)ÚOrderedDict)ÚTYPE_CHECKINGé   )ÚPreTrainedConfig)Úget_class_from_dynamic_moduleÚresolve_trust_remote_code)ÚImageProcessingMixin)	ÚCONFIG_NAMEÚIMAGE_PROCESSOR_NAMEÚPROCESSOR_NAMEÚcached_fileÚis_timm_config_dictÚis_timm_local_checkpointÚis_torchvision_availableÚloggingÚsafe_load_json_file)Úrequiresé   )Ú_LazyAutoMapping)ÚIMAGE_PROCESSOR_MAPPING_NAMES)ÚCONFIG_MAPPING_NAMESÚ
AutoConfigÚmodel_type_to_module_nameÚ!replace_list_option_in_docstrings)ÚChameleonImageProcessorÚFlavaImageProcessorÚIdefics3ImageProcessorÚSmolVLMImageProcessorr   Úaimv2ÚCLIPImageProcessorÚCLIPImageProcessorPil©ÚtorchvisionÚpilÚaimv2_vision_modelÚalignÚEfficientNetImageProcessorÚEfficientNetImageProcessorPilÚaltclipÚ
aya_visionÚGotOcr2ImageProcessorÚGotOcr2ImageProcessorPilzblip-2ÚBlipImageProcessorÚBlipImageProcessorPilÚclipsegÚViTImageProcessorÚViTImageProcessorPilÚcolpaliÚSiglipImageProcessorÚSiglipImageProcessorPilÚcolqwen2ÚQwen2VLImageProcessorÚQwen2VLImageProcessorPilÚ
convnextv2ÚConvNextImageProcessorÚConvNextImageProcessorPilÚcvtzdata2vec-visionÚBeitImageProcessorÚBeitImageProcessorPilÚdeimv2ÚRTDetrImageProcessorÚRTDetrImageProcessorPilÚdepth_anythingÚDPTImageProcessorÚDPTImageProcessorPilÚdinatÚdinov2ÚBitImageProcessorÚBitImageProcessorPilz
donut-swinÚDonutImageProcessorÚDonutImageProcessorPilÚedgetamr#   ÚSam2ImageProcessorÚemu3r$   ÚEmu3ImageProcessorÚeomt_dinov3ÚEomtImageProcessorÚEomtImageProcessorPilÚ	exaone4_5Ú	florence2ÚfocalnetÚgemma3nÚgitÚgranite4_visionÚLlavaNextImageProcessorÚLlavaNextImageProcessorPilÚgroupvitÚhieraÚijepaÚinstructblipÚinternvlzkosmos-2z
kosmos-2.5ÚKosmos2_5ImageProcessorÚKosmos2_5ImageProcessorPilÚ	layoutxlmÚLayoutLMv2ImageProcessorÚLayoutLMv2ImageProcessorPilÚlighton_ocrÚPixtralImageProcessorÚPixtralImageProcessorPilÚllava_next_videoÚlw_detrÚDeformableDetrImageProcessorÚDeformableDetrImageProcessorPilÚ
metaclip_2zmgp-strÚmistral3Úmlcdzmm-grounding-dinoÚGroundingDinoImageProcessorÚGroundingDinoImageProcessorPilÚmobilevitv2ÚMobileViTImageProcessorÚMobileViTImageProcessorPilzomdet-turboÚDetrImageProcessorÚDetrImageProcessorPilÚ	paligemmaÚpixioÚpp_ocrv5_mobile_detÚPPOCRV5ServerDetImageProcessorÚpp_ocrv5_mobile_recÚPPOCRV5ServerRecImageProcessorÚpvt_v2ÚPvtImageProcessorÚPvtImageProcessorPilÚqianfan_ocrÚqwen2_5_omniÚ
qwen2_5_vlÚqwen3_5Úqwen3_5_moeÚqwen3_omni_moeÚqwen3_vlÚregnetÚresnetÚ
sam2_videoÚsam3_lite_textÚSam3ImageProcessorÚsam3_trackerÚsam3_tracker_videoÚ
sam3_videoÚsam_hqÚSamImageProcessorÚSamImageProcessorPilÚshieldgemma2ÚGemma3ImageProcessorÚGemma3ImageProcessorPilÚslanetÚSLANeXtImageProcessorÚswiftformerÚswinÚswinv2Út5gemma2Út5gemma2_encoderztable-transformerÚtimesformerÚVideoMAEImageProcessorPilÚVideoMAEImageProcessor)r$   r#   Útimm_wrapperÚTimmWrapperImageProcessorÚtrocrÚudopÚLayoutLMv3ImageProcessorÚLayoutLMv3ImageProcessorPilÚupernetÚSegformerImageProcessorÚSegformerImageProcessorPilÚvideo_llavaÚVideoLlavaImageProcessorÚvipllavaÚvit_maeÚvit_msnÚvivitÚVivitImageProcessorÚxclipÚ
class_namec                 ó@  • U S:X  a  SSK Jn  U$ [        R                  R	                  5        HH  nUR	                  5        H1  n[        U[        5      (       d  M  [        USS5      U :X  d  M-  Us  s  $    MJ     [        R                  " 5        HK  u  pEXR	                  5       ;   d  M  [        U5      n[        R                  " SU 3S5      n [        Xp5      s  $    [        R                  " S5      n[        X€5      (       a  [        X€5      $ g! [         a     MŽ  f = f)	zÅResolve an image processor class name to its class. Handles both base names (e.g. CLIPImageProcessor)
and PIL backend names (e.g. CLIPImageProcessorPil). No recursion needed since names are direct.ÚBaseImageProcessorFastr   )ÚTorchvisionBackendÚ__name__NÚ.ztransformers.modelsÚtransformers)Úimage_processing_backendsr°   ÚIMAGE_PROCESSOR_MAPPINGÚ_extra_contentÚvaluesÚ
isinstanceÚtypeÚgetattrr   Úitemsr   Ú	importlibÚimport_moduleÚAttributeErrorÚhasattr)	r­   r°   ÚmappingÚextractor_classÚ
model_typeÚextractors_dictÚmodule_nameÚmoduleÚmain_modules	            Úk/home/mande/repo/quber/.venv/lib/python3.13/site-packages/transformers/models/auto/image_processing_auto.pyÚ#get_image_processor_class_from_namerÈ   ¤   s  € ð Ð-Ó-åCà!Ð!ô +×9Ñ9×@Ñ@ÖBˆØ&Ÿ~™~Ö/ˆOÜ˜/¬4×0Ó0´W¸_ÈjÐZ^Ó5_ÐcmÕ5mØ&Ô&ó  0ñ Cô (E×'JÒ'JÖ'LÑ#ˆ
Ø×/Ñ/Ó1Õ1Ü3°JÓ?ˆKÜ×,Ò,¨q°°Ð->Ð@UÓVˆFðÜ˜vÓ2Ò2ñ (Mô ×)Ò)¨.Ó9€KÜˆ{×'Ñ'Ü�{Ó/Ð/àøô "ó Úðús   Ã
DÄ
DÄDÚpretrained_model_name_or_pathÚ	cache_dirÚforce_downloadÚproxiesÚtokenÚrevisionÚlocal_files_onlyc                 ó   • [        U [        UUUUUUSSS9
n[        U [        UUUUUUSSS9
n	U	(       d  U(       d  [        R	                  S5        0 $ 0 n
Ub  [        U5      nSU;   a  US   n
U	b  U
c  [        U	5      n
U
$ )aA
  
Loads the image processor configuration from a pretrained model image processor configuration.

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

        - a string, the *model id* of a pretrained model configuration hosted inside a model repo on
          huggingface.co.
        - a path to a *directory* containing a configuration file saved using the
          [`~ProcessorMixin.save_pretrained`] method, e.g., `./my_model_directory/`.

    cache_dir (`str` or `os.PathLike`, *optional*):
        Path to a directory in which a downloaded pretrained model configuration 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 configuration files and override the cached versions if they
        exist.
    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`, 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.
    local_files_only (`bool`, *optional*, defaults to `False`):
        If `True`, will only try to load the image processor configuration from local files.

<Tip>

Passing `token=True` is required when you want to use a private model.

</Tip>

Returns:
    `Dict`: The configuration of the image processor.

Examples:

```python
# Download configuration from huggingface.co and cache.
image_processor_config = get_image_processor_config("google-bert/bert-base-uncased")
# This model does not have a image processor config so the result will be an empty dict.
image_processor_config = get_image_processor_config("FacebookAI/xlm-roberta-base")

# Save a pretrained image processor locally and you can reload its config
from transformers import AutoImageProcessor

image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
image_processor.save_pretrained("image-processor-test")
image_processor_config = get_image_processor_config("image-processor-test")
```F)	ÚfilenamerÊ   rË   rÌ   rÍ   rÎ   rÏ   Ú _raise_exceptions_for_gated_repoÚ%_raise_exceptions_for_missing_entriesz8Could not locate the image processor configuration file.Úimage_processor)r   r   r   ÚloggerÚinfor   )rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   ÚkwargsÚresolved_processor_fileÚresolved_image_processor_fileÚimage_processor_dictÚprocessor_dicts               rÇ   Úget_image_processor_configrÜ   Å   s¾   € ôD *Ø%ÜØØ%ØØØØ)Ø).Ø.3ñÐô %0Ø%Ü%ØØ%ØØØØ)Ø).Ø.3ñ%Ð!ö )Ö1HÜ�‰ÐNÔOØˆ	ð
 ÐØÑ*Ü,Ð-DÓEˆØ Ó.Ø#1Ð2CÑ#DÐ à$Ñ0Ð5IÑ5QÜ2Ð3PÓQÐàÐó    ÚbackendÚuse_fastÚbase_class_nameÚreturnc                 ó”   • Ub#  [         R                  S5        U c  U(       a  SOSn U c  U[        ;   a  g[        5       (       a  S$ S$ U $ )aÝ  Resolve raw backend inputs to a concrete backend name ('torchvision' or 'pil').

Handles, in order:
- Deprecated ``use_fast`` flag: warns and converts to an explicit backend string when no
  explicit backend is given.
- Explicit backend string: returned as-is.
- None resolution: forces 'pil' for processors in DEFAULT_TO_PIL_BACKEND_IMAGE_PROCESSORS
  (Lanczos interpolation, unsupported by torchvision); otherwise picks 'torchvision' when
  available, falling back to 'pil'.
z·The `use_fast` parameter is deprecated and will be removed in a future version. Use `backend="torchvision"` instead of `use_fast=True`, or `backend="pil"` instead of `use_fast=False`.r#   r$   )rÕ   Úwarning_onceÚ'DEFAULT_TO_PIL_BACKEND_IMAGE_PROCESSORSr   )rÞ   rß   rà   s      rÇ   Ú_resolve_backendrå   4  sW   € ð ÑÜ×Ñðvô	
ð ‰?Þ'/‘m°UˆGà�ØÔEÓEØÜ 8× :Ñ :ˆ}ÐEÀÐEà€NrÝ   c                 óB  • U/U  Vs/ s H  o"U:w  d  M
  UPM     sn-   nU Hv  nU R                  U5      nUc  M  [        U[        5      (       a  UnO[        U5      nUb  [	        USS5      (       a  MS  XA:w  a  [
        R                  SU SU S35        Us  $    gs  snf )aY  
Load an image processor class from a backend-to-class mapping, with fallback.

Tries the requested backend first, then the opposite standard backend,
then any remaining backends. Works with both string class names and resolved class objects.

Unavailable backends are detected via DummyObject: classes whose required libraries are missing
are represented as DummyObject subclasses (is_dummy=True). When the torchvision backend is
missing but a PIL variant exists, _LazyModule transparently returns the PIL class with its own
warning, so _load_class_with_fallback naturally receives a usable class without extra gating.

Args:
    mapping: dict mapping backend names (str) to class names (str) or class objects (type).
    backend: the preferred backend name (e.g. "torchvision", "pil").

Returns:
    The loaded class, or None if no class could be loaded.
NÚis_dummyFz
Requested z+ backend is not available. Falling back to z	 backend.)Úgetr¸   r¹   rÈ   rº   rÕ   rã   )rÀ   rÞ   ÚkÚbackends_to_tryÚbÚvalueÚprocessor_classs          rÇ   Ú_load_class_with_fallbackrî   O  s®   € ð& �i©gÓ"Fªg¨¸g¹§1©gÑ"FÑF€OãˆØ—‘˜A“ˆØ‰=Ùô �eœT×"Ñ"Ø#‰OäAÀ%ÓHˆOàÑ"¤g¨o¸zÈ5×&QÑ&QÙà‹<Ü×Ñ *¨W¨IÐ5`ÐabÐ`cÐclÐ mÔnØÒñ! ð$ ùò) #Gs
   ‡	B”Bc                 ó`  ^ ^• S[         S[        4S jm[        R                  " 5        H0  n[	        UU 4S jUR                  5        5       5      (       d  M.  Us  $    [
        R                  R                  5        H0  n[	        UU 4S jUR                  5        5       5      (       d  M.  Us  $    g)z›
Find the backend->class mapping that contains base_class_name in its values.
Returns the mapping dict (including any custom registered backends) or None.
Únamerá   c                 óˆ   • U c  g[        U [        5      (       a  X:H  $ [        U [        5      (       a  [        U SS 5      U:H  $ g)NFr±   )r¸   Ústrr¹   rº   )Úvalrð   s     rÇ   Ú_value_matchesÚ9_find_mapping_for_image_processor.<locals>._value_matches  sC   € Ø‰;ØÜ�cœ3×ÑØ‘;ÐÜ�cœ4× Ñ Ü˜3 
¨DÓ1°TÑ9Ð9ØrÝ   c              3   ó6   >#   • U  H  nT" UT5      v •  M     g 7f©N© ©Ú.0Úvrô   rà   s     €€rÇ   Ú	<genexpr>Ú4_find_mapping_for_image_processor.<locals>.<genexpr>‰  s   øé € ÐQÒ;P°a‰~˜a ×1Ð1Ò;Pùó   ƒc              3   ó6   >#   • U  H  nT" UT5      v •  M     g 7fr÷   rø   rù   s     €€rÇ   rü   rý   �  s   øé € ÐLÒ;K°a‰~˜a ×1Ð1Ò;Kùrþ   N)rò   Úboolr   r·   Úanyrµ   r¶   )rà   Úmapping_dictÚcontentrô   s   `  @rÇ   Ú!_find_mapping_for_image_processorr  y  s‰   ù€ ð¤#ð ¬$ô ô 6×<Ò<Ö>ˆÜÕQ¸<×;NÑ;NÔ;PÓQ×QÓQØÒñ ?ô +×9Ñ9×@Ñ@ÖBˆÜÕL¸7¿>¹>Ô;KÓL×LÓLØŠNñ Cð rÝ   c                 óx   • [        U 5      nUc  U U S-   S.n[        X15      nUc  U(       a  [        U S-   5      nU$ )a  
Load image processor class for a given backend. Uses the mapping from
IMAGE_PROCESSOR_MAPPING when base_class_name is found in its values (so config
overrides and custom backends are respected). Falls back to base+Pil convention
for remote code / unknown processors.
ÚPilr"   ÚFast)r  rî   rÈ   )rà   rÞ   Úis_legacy_fastrÀ   rí   s        rÇ   Ú_load_backend_classr	  “  sQ   € ô 0°Ó@€GØ�à*Ø" UÑ*ñ
ˆô 0°ÓA€Oð Ñ¦>Ü=¸oÐPVÑ>VÓWˆàÐrÝ   c                 ó$  • [        U [        5      (       a:  U R                  U5      =(       d"    [        [	        U R                  5       5      5      $ [        U [        [        45      (       a%  US:X  a  [        U 5      S:”  a  U S   b  U S   $ U S   $ U $ )ab  Extract the class reference string from an auto_map entry based on backend preference.

Returns:
    A string that may be:
    - A simple class name (e.g. `"MyImageProcessor"`)
    - A Hub reference in the form `upstream_repo--path/to/file.py::ClassName`, where the part before
      `--` is the upstream repo ID (used for trust_remote_code resolution).
r#   r   r   )	r¸   Údictrè   ÚnextÚiterr·   ÚlistÚtupleÚlen)Úauto_maprÞ   s     rÇ   Ú_resolve_auto_map_class_refr  ©  s|   € ô �(œD×!Ñ!Ø�|‰|˜GÓ$×E¬¬T°(·/±/Ó2CÓ-DÓ(EÐEÜ�(œT¤5˜M×*Ñ*Ø�mÓ#¬¨H«¸Ó(9¸hÀq¹kÑ>UØ˜A‘;ÐØ˜‰{Ðà€OrÝ   )Úvision)Úbackendsc            
       ó�   • \ rS rSrSrS r\\" \5      S 5       5       r	\
    SS\S-  S\S-  S\\\4   S-  S	\4S
 jj5       rSrg)ÚAutoImageProcessori¼  a  
This is a generic image processor class that will be instantiated as one of the image processor classes of the
library when created with the [`AutoImageProcessor.from_pretrained`] class method.

This class cannot be instantiated directly using `__init__()` (throws an error).
c                 ó   • [        S5      e)Nz‡AutoImageProcessor is designed to be instantiated using the `AutoImageProcessor.from_pretrained(pretrained_model_name_or_path)` method.)ÚOSError)Úselfs    rÇ   Ú__init__ÚAutoImageProcessor.__init__Å  s   € Üðdó
ð 	
rÝ   c                 ón  • UR                  SS5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nSUS'   SU;   a  UR                  S5      nO[        U5      (       a  [        nO[        n [        R
                  " U4SU0UD6u  pšU	R                  S	S5      nSnS
U	R                  S0 5      ;   a  U	S   S
   nUcZ  UcW  U	R                  SS5      nUb  UR                  SS5      nSU	R                  S0 5      ;   a  U	S   S   nUR                  SS5      nUcs  Ub  USL ak  [        U[        5      (       d  [        R                  " U4SU0UD6n[        US	S5      n[        US5      (       a  S
UR                   ;   a  UR                   S
   nSnSnUb  UR#                  S5      nU(       a  USS OUn[%        XeU5      nSnUb  ['        UUU5      nUSLnUSL=(       d    [)        U5      [*        ;   nU=(       aC    U=(       d    [-        [*        [)        U5         U5      R.                  R1                  S5      (       + nU(       a6  [3        UU5      nSU;   a  UR5                  S5      S   OSn[7        XqUUU5      nU(       aS  U(       aL  U(       dE  [9        WU40 UD6nUR                  SS5      n
UR;                  5         UR                  " U/UQ70 UD6$ Ub  UR                  " U/UQ70 UD6$ [)        U5      [*        ;   a~  [*        [)        U5         n[-        UU5      nUb  UR                  " U/UQ70 UD6$ UR=                  5        VVs/ s H  u  nnUc  M  UPM     nnn[?        SSRA                  U5       35      e[?        SU S[         S[         S[         SSRA                  S [B         5       5       3
5      e! [         aN  n [        R
                  " U4S[        0UD6u  pšO! [         a    Uef = f[        U	5      (       d  Ue SnAGNŠSnAff = fs  snnf )a»  
Instantiate one of the image processor classes of the library from a pretrained model vocabulary.

The image processor class to instantiate is selected based on the `model_type` property of the config object
(either passed as an argument or loaded from `pretrained_model_name_or_path` if possible), or when it's
missing, by falling back to using pattern matching on `pretrained_model_name_or_path`:

List options

Params:
    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 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.
    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`, 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.
    use_fast (`bool`, *optional*, defaults to `False`):
        **Deprecated**: Use `backend="torchvision"` instead. This parameter is kept for backward compatibility.
        Use a fast torchvision-based image processor if it is supported for a given model.
        If a fast image processor is not available for a given model, a normal numpy-based image processor
        is returned instead.
    backend (`str`, *optional*, defaults to `None`):
        The backend to use for image processing. Can be:
        - `None`: Automatically select the best available backend (torchvision if available, otherwise pil)
        - `"torchvision"`: Use Torchvision backend (GPU-accelerated, faster)
        - `"pil"`: Use PIL backend (portable, CPU-only)
        - Any custom backend name registered via `register()` method
    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.
    trust_remote_code (`bool`, *optional*, defaults to `False`):
        Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
        should only be set to `True` for repositories you trust and in which you have read the code, as it will
        execute code present on the Hub on your local machine.
    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.
    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.

<Tip>

Passing `token=True` is required when you want to use a private model.

</Tip>

Examples:

```python
>>> from transformers import AutoImageProcessor

>>> # Download image processor from huggingface.co and cache.
>>> image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")

>>> # If image processor files are in a directory (e.g. image processor was saved using *save_pretrained('./test/saved_model/')*)
>>> # image_processor = AutoImageProcessor.from_pretrained("./test/saved_model/")
```ÚconfigNrß   rÞ   Útrust_remote_codeTÚ
_from_autoÚimage_processor_filenameÚimage_processor_typer  r  Úfeature_extractor_typeÚFeatureExtractorÚImageProcessorÚAutoFeatureExtractorFr  éüÿÿÿztransformers.z--r   Úcode_revisionz:Could not find image processor class. Available backends: z, z Unrecognized image processor in z2. Should have a `image_processor_type` key in its z of z3, or one of the following `model_type` keys in its z: c              3   ó$   #   • U  H  ov •  M     g 7fr÷   rø   )rú   Úcs     rÇ   rü   Ú5AutoImageProcessor.from_pretrained.<locals>.<genexpr>†  s   é € Ð@jÒLiÀqÄÒLiùs   ‚)"Úpopr   r
   r   r	   Úget_image_processor_dictÚ	Exceptionr   rè   Úreplacer¸   r   r   Úfrom_pretrainedrº   r¿   r  Úendswithrå   r	  r¹   rµ   rî   Ú
__module__Ú
startswithr  Úsplitr   r   Úregister_for_auto_classr»   Ú
ValueErrorÚjoinr   )ÚclsrÉ   Úinputsr×   r  rß   Úbackend_kwargr  r   Úconfig_dictÚ_Úinitial_exceptionr!  Úimage_processor_auto_mapÚfeature_extractor_classÚfeature_extractor_auto_mapr  rà   rÞ   Úimage_processor_classÚhas_remote_codeÚhas_local_codeÚexplicit_local_codeÚ	class_refÚupstream_repoÚimage_processor_mappingré   rû   Ú	availables                                rÇ   r/  Ú"AutoImageProcessor.from_pretrainedË  s¼  € ðf —‘˜H dÓ+ˆØ—:‘:˜j¨$Ó/ˆØŸ
™
 9¨dÓ3ˆØ"ŸJ™JÐ':¸DÓAÐØ#ˆˆ|Ñð &¨Ó/Ø'-§z¡zÐ2LÓ'MÑ$Ü%Ð&C×DÑDÜ'2Ñ$ä';Ð$ð	(Ü1×JÒJØ-ñØH`ðØdjñ‰NˆKð  +Ÿ™Ð/EÀtÓLÐØ#'Ð Ø ;§?¡?°:¸rÓ#BÓBØ'2°:Ñ'>Ð?SÑ'TÐ$ð  Ñ'Ð,DÑ,LØ&1§o¡oÐ6NÐPTÓ&UÐ#Ø&Ñ2Ø'>×'FÑ'FÐGYÐ[kÓ'lÐ$Ø%¨¯©¸ÀRÓ)HÓHØ-8¸Ñ-DÐE[Ñ-\Ð*Ø+E×+MÑ+MÐN`ÐbrÓ+sÐ(ð  Ñ'Ð-EÑ-MÐQbÐfkÒQkÜ˜fÔ&6×7Ñ7Ü#×3Ò3Ø1ñà&7ðð ñ�ô
 $+¨6Ð3IÈ4Ó#PÐ Ü�v˜z×*Ñ*Ð/CÀvÇÁÓ/VØ+1¯?©?Ð;OÑ+PÐ(ð ˆØˆØÑ+Ø1×:Ñ:¸6ÓBˆNÞ;IÐ2°3°BÑ7ÐOcˆOä" =¸OÓLˆà $ÐØÑ&Ü$7¸ÈÐR`Ó$aÐ!ð 3¸$Ð>ˆØ.°dÐ:×e¼dÀ6»lÔNeÑ>eˆØ,÷ 1Ø!×nÔ%>Ô?VÔW[Ð\bÓWcÑ?dÐfmÓ%nß
‰*—Z‘Z Ó0ô21Ðö Ü3Ð4LÈgÓVˆIØ8<À	Ó8I˜IŸO™O¨DÓ1°!Ò4ÈtˆMÜ 9Ø!À.ÐRaÐcpó!Ðö Ö0Ö9LÜ$AÀ)ÐMjÑ$uÐntÑ$uÐ!Ø—
‘
˜?¨DÓ1ˆAØ!×9Ñ9Ô;Ø(×8Ò8Ð9VÐjÐY_ÒjÐciÑjÐjØ"Ñ.Ø(×8Ò8Ð9VÐjÐY_ÒjÐciÑjÐjä�&‹\Ô4Ó4Ü&=¼dÀ6»lÑ&KÐ#Ü$=Ð>UÐW^Ó$_Ð!à$Ñ0Ø,×<Ò<Ð=ZÐnÐ]cÒnÐgmÑnÐnà'>×'DÑ'DÔ'FÔXÒ'F™t˜q !È!ŸÑ'FˆIÑXÜÐYÐZ^×ZcÑZcÐdmÓZnÐYoÐpÓqÐqÜØ.Ð/LÐ.Mð N1Ü1EÐ0FÀdÌ;È-ð X(Ü(3 }°B°t·y±yÑ@jÕLiÓ@jÓ7jÐ6kðmó
ð 	
øôc ó 
	(ð(Ü!5×!NÒ!NØ1ñ"ÜLWð"Ø[añ"‘�˜Qøô ó (Ø'Ð'ð(úô ' {×3Ñ3Ø'Ð'õ 4ûð
	(üó^ Ys6   ÂO Í"
P1Í0P1Ï
P.Ï!PÐ P)ÐPÐP)Ð)P.NÚslow_image_processor_classÚfast_image_processor_classÚimage_processor_classesÚexist_okc                 ó`  • Uc  0 nUb  XS'   Ub  X#S'   U(       d  [        S5      eU [        R                  ;   a  [        U    nUR                  U5        UnSSKJn  UR                  5        H+  u  pxUc  M
  [        X†5      (       a  M  [        SU SU 35      e   [        R                  XUS	9  g)
av  
Register a new image processor for this class.

Args:
    config_class ([`PreTrainedConfig`]):
        The configuration corresponding to the model to register.
    slow_image_processor_class (`type`, *optional*):
        The PIL backend image processor class (deprecated, use `image_processor_classes={"pil": ...}`).
    fast_image_processor_class (`type`, *optional*):
        The Torchvision backend image processor class (deprecated, use `image_processor_classes={"torchvision": ...}`).
    image_processor_classes (`dict[str, type]`, *optional*):
        Dictionary mapping backend names to image processor classes. Allows registering custom backends.
        Example: `{"pil": MyPilProcessor, "torchvision": MyTorchvisionProcessor, "custom": MyCustomProcessor}`
    exist_ok (`bool`, *optional*, defaults to `False`):
        If `True`, allow overwriting existing registrations.
Nr$   r#   zÎYou need to specify at least one image processor class. Use `image_processor_classes={'backend_name': ProcessorClass}` or the deprecated `slow_image_processor_class`/`fast_image_processor_class` parameters.r   )ÚBaseImageProcessorz#Image processor class for backend 'z/' must inherit from `BaseImageProcessor`. Got: )rL  )	r5  rµ   r¶   ÚupdateÚimage_processing_utilsrN  r»   Ú
issubclassÚregister)	Úconfig_classrI  rJ  rK  rL  Úexisting_mappingrN  Úbackend_keyrí   s	            rÇ   rR  ÚAutoImageProcessor.register‰  sÛ   € ð2 #Ñ*Ø&(Ð#Ø)Ñ5Ø1K¨Ñ.Ø)Ñ5Ø9S¨Ñ6æ&ÜðXóð ð Ô2×AÑAÓAÜ6°|ÑDÐØ×#Ñ#Ð$;Ô<Ø&6Ð#õ 	Aà,C×,IÑ,IÖ,KÑ(ˆKØÓ*´:¸o×3bÓ3bÜ Ø9¸+¸ð GØ+Ð,ð.óð ñ -Lô 	 ×(Ñ(¨ÐYaÐ(ÒbrÝ   rø   )NNNF)r±   r1  Ú__qualname__Ú__firstlineno__Ú__doc__r  Úclassmethodr   r   r/  Ústaticmethodr¹   r  rò   r   rR  Ú__static_attributes__rø   rÝ   rÇ   r  r  ¼  s•   † ñò
ð Ù&Ð'DÓEñz
ó Fó ðz
ðx ð 37Ø26Ø:>Øñ5cà$(¨4¡Kð5cð %)¨4¡Kð5cð "& c¨4 i¡°4Ñ!7ð	5cð
 ô5có ó5crÝ   r  rµ   )NFNNNF)F)8rY  r¼   ÚosÚcollectionsr   Útypingr   Úconfiguration_utilsr   Údynamic_module_utilsr   r   rP  r	   Úutilsr
   r   r   r   r   r   r   r   r   Úutils.import_utilsr   Úauto_factoryr   Úauto_mappingsr   Úconfiguration_autor   r   r   r   Ú
get_loggerr±   rÕ   rä   rò   r  Ú__annotations__Ú%MISSING_IMAGE_PROCESSOR_MAPPING_NAMESrO  rµ   rÈ   ÚPathLiker   rÜ   rå   rî   r  r	  r  r  Ú__all__rø   rÝ   rÇ   Ú<module>rl     s½	  ðò  ã Û 	Ý #Ý  õ 4ß \Ý :÷
÷ 
õ 
õ +Ý *Ý 8÷ó ð 
×	Ò	˜HÓ	%€ò+Ð 'ö ñ NYË]Ð! ;¨s°D¸¸cÀD¹j¸Ñ4IÐ/IÑ#JÕZñ -8ðZ	
ØÐ&:ÐCZÑ[Ð\ðZ	
à!Ð3GÐPgÑ#hÐiðZ	
ð Ð&BÐKjÑkÐlðZ	
ð Ð(<ÐE\Ñ]Ð^ð	Z	
ð
 Ð+BÐKeÑfÐgðZ	
ð Ð';ÐD[Ñ\Ð]ðZ	
ð Ð(;ÐDZÑ[Ð\ðZ	
ð Ð(>ÐG`ÑaÐbðZ	
ð Ð)@ÐIcÑdÐeðZ	
ð Ð+CÐLgÑhÐiðZ	
ð Ð$<ÐE`ÑaÐbðZ	
ð Ð0DÐMdÑ eÐfðZ	
ð Ð'=ÐF_Ñ`ÐaðZ	
ð Ð/BÐKaÑbÐcðZ	
ð Ð&9ÐBXÑYÐZðZ	
ð  Ð':ÐCYÑZÐ[ð!Z	
ð" Ð+@ÐIaÑbÐcð#Z	
ð$ ˜Ð(<Ð=Ð>ð%Z	
ð& �eÐ1Ð2Ð3ð'Z	
ð( Ð,@ÐI`ÑaÐbð)Z	
ð* Ð*AÐJdÑeÐfð+Z	
ð, Ð*>ÐG^Ñ_Ð`ð-Z	
ð. Ð)<ÐE[Ñ\Ð]ð/Z	
ð0 Ð(>ÐG`ÑaÐbð1Z	
ð2 Ð$8ÐAXÑYÐZð3Z	
ð4 Ð0IÐRnÑ oÐpð5Z	
ð6 Ð)=ÐF]Ñ^Ð_ð7Z	
ð8 Ð&9ÐBXÑYÐZð9Z	
ð: Ð&9ÐBXÑYÐZð;Z	
ð< Ð-AÐJaÑbÐcð=Z	
ð> Ð)@ÐIcÑdÐeð?Z	
ð@ Ð)=ÐF]Ñ^Ð_ðAZ	
ðB Ð+DÐMiÑjÐkðCZ	
ðD Ð*DÐMjÑkÐlðEZ	
ðF Ð,CÐLfÑgÐhðGZ	
ðH  Ð1JÐSoÑ!pÐqðIZ	
ðJ Ð(FÐOpÑqÐrðKZ	
ðL Ð+?ÐH_Ñ`ÐaðMZ	
ðN Ð(;ÐDZÑ[Ð\ðOZ	
ðP Ð)@ÐIcÑdÐeðQZ	
ðR Ð%9ÐBYÑZÐ[ðSZ	
ðV $à#@Ø;ñððUZ	
ðb Ð,EÐNjÑkÐlðcZ	
ðd Ð,@ÐI`ÑaÐbðeZ	
ðf Ð*@ÐIbÑcÐdðgZ	
ðh Ð&9ÐBXÑYÐZðiZ	
ðj # ]Ð4TÐ$UÐVðkZ	
ðl # ]Ð4TÐ$UÐVðmZ	
ðn Ð':ÐCYÑZÐ[ðoZ	
ðp Ð,CÐLfÑgÐhðqZ	
ðr Ð-DÐMgÑhÐiðsZ	
ðt Ð+BÐKeÑfÐgðuZ	
ðv Ð(?ÐHbÑcÐdðwZ	
ðx Ð,CÐLfÑgÐhðyZ	
ðz Ð/FÐOiÑjÐkð{Z	
ð| Ð)@ÐIcÑdÐeð}Z	
ð~ Ð'?ÐHcÑdÐeðZ	
ð@ Ð'?ÐHcÑdÐeðAZ	
ðB ˜MÐ+?Ð@ÐAðCZ	
ðD  Ð/CÐDÐEðEZ	
ðF ˜mÐ-AÐBÐCðGZ	
ðH " MÐ3GÐ#HÐIðIZ	
ðJ ˜MÐ+?Ð@ÐAðKZ	
ðL Ð':ÐCYÑZÐ[ðMZ	
ðN Ð-CÐLeÑfÐgðOZ	
ðP ˜Ð'>Ð?Ð@ðQZ	
ðR Ð,?ÐH^Ñ_Ð`ðSZ	
ðT Ð%8ÐAWÑXÐYðUZ	
ðV Ð':ÐCYÑZÐ[ðWZ	
ðX Ð)?ÐHaÑbÐcðYZ	
ðZ  Ð1GÐPiÑ!jÐkð[Z	
ð\ !Ð2FÐOfÑ"gÐhð]Z	
ð^ Ð$?ÐPhÑiÐjð_Z	
ð` ˜eÐ%@ÐAÐBðaZ	
ðb Ð&9ÐBXÑYÐZðcZ	
ðd Ð%?ÐHeÑfÐgðeZ	
ðf Ð(AÐJfÑgÐhðgZ	
ðh ˜UÐ$>Ð?Ð@ðiZ	
ðj Ð)=ÐF]Ñ^Ð_ðkZ	
ðl Ð(;ÐDZÑ[Ð\ðmZ	
ðn Ð(;ÐDZÑ[Ð\ðoZ	
ðp �}Ð&;Ð<Ð=ðqZ	
ðr Ð&:ÐCZÑ[Ð\ðsZ	
ó\-Ð)ð| "×(Ò(Ð)NÔOá*Ð+?ÐA^Ó_Ð ð°Cô ðF +/Ø Ø%)Ø#ØØ"ñl Ø#&¨¯©Ñ#4ðl à�R—[‘[Ñ  4Ñ'ðl ð ðl ð �#�s�(‰^˜dÑ"ð	l ð
 �#‰:˜Ñðl ð �D‰jðl ð õl ð^˜c D™jð °D¸4±Kð ÐRUÐX\ÑR\ð Ðadô ò6'ðT°sð ¸tÀd¹{ô ô4ò,ñ& 
�;Ñ÷Bcð Bcó  ðBcðJ %Ð&:Ð
;�rÝ   