
    Z ju                        % 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SS>S?04PSS>S04PSS>S04PSS>S04PSS>S04PSSSS.4PSSSS.4PSS>S04PSS!S"S.4PSS!S"S.4PSS!S"S.4PSSSS.4PSSSS.4PSSlSmS.4PSSSS.4PSSAS04PSS!S"S.4PSSSS.4PSSSS.4PSSAS04PSSSS.4PSS!S"S.4PSS!S"S.4PSS>S04PSSSS.4P5      r*\RV                  " \*5        \" \\5      r,S\'4S jr-      SS\'\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r3SS jr4S r5\" SS9 " S S5      5       r6SS/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[        X5      (       a  [        X5      $ g! [         a     M  f = f)	zResolve 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	            /root/GenerationalWealth/GenerationalWealth/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0W_jZ^5_cm5m&&  0 C (E'J'J'L#
//113J?K,,q->@UVFv22 (M )).9K{''{// " 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.#12C#D $05I5Q23P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'.
zThe `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	
 ?'/mUG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    & ig"Fgg1g"FFOA= eT""#OA%HO"goz5&Q&Q<*WI5`ab`ccl 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_matches9_find_mapping_for_image_processor.<locals>._value_matches  sC    ;c3;c4  3
D1T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;Pa~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;Ka~a11;Kr   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L7>>;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AO >=oPV>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(T5M**m#H(9hqk>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)NzAutoImageProcessor 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  pU	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  pO! [         a    Uef = f[        U	5      (       d  Ue SnAGNS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     @jLiqLis   )"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 Hd+::j$/

9d3"JJ':DA#| &/'-zz2L'M$%&CDD'2$';$	(1JJ-H`djNK  +/EtL#' ;??:r#BB'2:'>?S'T$  ',D,L&1oo6NPT&U#&2'>'F'FGY[k'l$%R)HH-8-DE[-\*+E+M+MN`br+s(  '-E-MQbfkQkf&677#331&7 
 $+63I4#P vz**/Cv/V+1??;O+P( +1::6BN;I23B7OcO"=OL $&$7R`$a! 3$>.d:ed6lNe>e, 1!n%>?VW[\bWc?dfm%n
*ZZ021 34LgVI8<	8IIOOD1!4tM 9!.Racp! 09L$A)Mj$unt$u!

?D1A!99;(889VjY_jcijj".(889VjY_jcijj&\44&=d6l&K#$=>UW^$_!$0,<<=Zn]cngmnn'>'D'D'FX'Ftq!!'FIXYZ^ZcZcdmZnYopqq./L.M N11E0Fd;- X((3}Btyy@jLi@j7j6k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
  [        X5      (       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#   zYou 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 #*&(#)51K.)59S6&X  2AAA6|D##$;<&6# 	A,C,I,I,K(K*:o3b3b 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  3726:>5c$(4K5c %)4K5c "&c4i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]!;sDcDj4I/I#JZ -8Z	
&:CZ[\Z	
!3GPg#hiZ	
 &BKjklZ	
 (<E\]^	Z	

 +BKefgZ	
 ';D[\]Z	
 (;DZ[\Z	
 (>G`abZ	
 )@IcdeZ	
 +CLghiZ	
 $<E`abZ	
 0DMd efZ	
 '=F_`aZ	
 /BKabcZ	
 &9BXYZZ	
  ':CYZ[!Z	
" +@Iabc#Z	
$ (<=>%Z	
& e123'Z	
( ,@I`ab)Z	
* *AJdef+Z	
, *>G^_`-Z	
. )<E[\]/Z	
0 (>G`ab1Z	
2 $8AXYZ3Z	
4 0IRn op5Z	
6 )=F]^_7Z	
8 &9BXYZ9Z	
: &9BXYZ;Z	
< -AJabc=Z	
> )@Icde?Z	
@ )=F]^_AZ	
B +DMijkCZ	
D *DMjklEZ	
F ,CLfghGZ	
H  1JSo!pqIZ	
J (FOpqrKZ	
L +?H_`aMZ	
N (;DZ[\OZ	
P )@IcdeQZ	
R %9BYZ[SZ	
V $#@;UZ	
b ,ENjklcZ	
d ,@I`abeZ	
f *@IbcdgZ	
h &9BXYZiZ	
j #]4T$UVkZ	
l #]4T$UVmZ	
n ':CYZ[oZ	
p ,CLfghqZ	
r -DMghisZ	
t +BKefguZ	
v (?HbcdwZ	
x ,CLfghyZ	
z /FOijk{Z	
| )@Icde}Z	
~ '?HcdeZ	
@ '?HcdeAZ	
B M+?@ACZ	
D /CDEEZ	
F m-ABCGZ	
H "M3G#HIIZ	
J M+?@AKZ	
L ':CYZ[MZ	
N -CLefgOZ	
P '>?@QZ	
R ,?H^_`SZ	
T %8AWXYUZ	
V ':CYZ[WZ	
X )?HabcYZ	
Z  1GPi!jk[Z	
\ !2FOf"gh]Z	
^ $?Phij_Z	
` e%@ABaZ	
b &9BXYZcZ	
d %?HefgeZ	
f (AJfghg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  Djl  l ^cDj D4K RUX\R\ ad 6'Ts td{ 4,& 
;Bc Bc  BcJ %&:
;r   