+
    œ°³js…  ã                   óÎ  € ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	t
^ RIHt ^ RIHt ^RIHt ^RIHt ^R	IHt ^R
IHtHtHtHt ^RIHtHt ^RIHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t( ^RI)H*t*H+t+ ^RI,H-t- ^RI.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9 ]$! 4       '       d   ^ RI:t:]&! 4       '       d   ^ RI;H<u H=u H>t? ]! 4       '       d   ^RIH@t@ ]'P‚                  ! ]B4      tC]-! RR7       ! R R]4      4       tD]#! ]DPŠ                  4      ]DnE        ]DPŠ                  PŒ                  e:   ]DPŠ                  PŒ                  P�                  RRRR7      ]DPŠ                  nF        R# R# )é    N)ÚCallable)Úpartial)ÚAny)Úis_offline_mode)Úvalidate_typed_dict)Úcustom_object_save)ÚTorchvisionBackend©ÚBatchFeature)ÚChannelDimensionÚSizeDictÚis_vision_availableÚvalidate_kwargs©ÚUnpackÚVideosKwargs)ÚIMAGE_PROCESSOR_NAMEÚPROCESSOR_NAMEÚVIDEO_PROCESSOR_NAMEÚ
TensorTypeÚauto_docstringÚ	copy_funcÚis_torch_availableÚis_torchcodec_availableÚis_torchvision_v2_availableÚloggingÚsafe_load_json_file)Úcached_fileÚhf_api)Úrequires)Ú TORCHVISION_VIDEO_DECODING_ERRORÚ
VideoInputÚVideoMetadataÚgroup_videos_by_shapeÚinfer_channel_dimension_formatÚ'is_torchvision_video_decoding_availableÚis_valid_videoÚ
load_videoÚmake_batched_metadataÚmake_batched_videosÚreorder_videos)ÚPILImageResampling)Úbackendsc                   ó"  a a€ ] tR t^Ot oRtRtRtRtRtRt	Rt
RtRtRtRtR*tRtRtRtRtRtRtRt]tR.tV3R lV 3R lltV3R lR ltV3R	 lR
 ltR+V3R lR lltR+V3R lR lltR+V3R lR llt] V3R lR l4       t!R,V3R lR llt"]#R-V3R lR ll4       t$R.V3R lR llt%]#V3R lR l4       t&]#V3R lR l4       t'V3R lV 3R llt(V3R lR  lt)V3R! lR" lt*R# t+]#V3R$ lR% l4       t,]#R/R& l4       t-R,V3R' lR( llt.R)t/Vt0V ;t1# )0ÚBaseVideoProcessorNTFÚpixel_values_videosc                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )é   ÚkwargsÚreturnNr   )ÚformatÚ__classdict__s   "€Úd/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/video_processing_utils.pyÚ__annotate__ÚBaseVideoProcessor.__annotate__h   s    ø€ ÷ #ñ #¡©Õ!5ð #¸$ñ #ó    c                ó(   <€ \         SV `  ! R/ VB  R # )N© )ÚsuperÚ__init__)Úselfr3   Ú	__class__s   &,€r7   r>   ÚBaseVideoProcessor.__init__h   s   ø€ Ü‰ÒÑ"˜6Ô"r:   c                ó    <€ V ^8„  d   QhRS[ /# ©r2   r4   r
   )r5   r6   s   "€r7   r8   r9   k   s   ø€ ÷ 1ñ 1©Lñ 1r:   c                ó(   € V P                   ! V3/ VB # ©N)Ú
preprocess)r?   Úvideosr3   s   &&,r7   Ú__call__ÚBaseVideoProcessor.__call__k   s   € Ø�Š˜vÑ0¨Ñ0Ð0r:   c                ó$   <€ V ^8„  d   QhRRRS[ /# )r2   Úvideoútorch.Tensorr4   )r"   )r5   r6   s   "€r7   r8   r9   n   s   ø€ ÷ ñ àðñ 
ñr:   c                ó:  € \         P                  ! V4      pVP                  R,          ^8X  g!   VR,          ^ÿ8  P                  4       '       g
   VR,          # VR,          R,          p^VR,          ,
          ^ÿ,          VR,          VR,          ,          ,           pV# )z—
Converts a video to RGB format.

Args:
    video (`"torch.Tensor"`):
        The video to convert.

Returns:
    `torch.Tensor`: The converted video.
g     ào@éýÿÿÿ).é   ºNNNrP   ).:NrO   NrP   rP   ).NrP   rP   )ÚtvFÚgrayscale_to_rgbÚshapeÚany)r?   rK   Úalphas   && r7   Úconvert_to_rgbÚ!BaseVideoProcessor.convert_to_rgbn   s†   € ô ×$Ò$ UÓ+ˆØ�;‰;�r�?˜aÔ¨¨lÕ(;¸cÑ(A×'FÑ'F×'HÒ'HØ˜Õ'Ð'ð �lÕ# eÕ+ˆØ�U˜?Õ+Õ+¨sÕ2°U¸?Õ5KÈeÐTaÕNbÕ5bÕbˆØˆr:   c                óX   <€ V ^8„  d   QhRS[ RS[R,          RS[S[,          R,          /# )r2   ÚmetadataÚ
num_framesNÚfps)r#   ÚintÚfloat)r5   r6   s   "€r7   r8   r9   ‡   s6   ø€ ÷ 3ñ 3áð3ñ ˜$•Jð3ñ ‘5�[˜4Õñ	3r:   c                óø  € Ve   Ve   \        R4      hVe   TMV P                  pVe   TMV P                  pVP                  pVfD   Ve@   Ve   VP                  f   \        R4      h\	        WQP                  ,          V,          4      pW%8”  d   \        RV RV R24      hVe/   \
        P                  ! ^ WUV,          4      P	                  4       pV# \
        P                  ! ^ V4      P	                  4       pV# )aµ  
Default sampling function which uniformly samples the desired number of frames between 0 and total number of frames.
If `fps` is passed along with metadata, `fps` frames per second are sampled uniformly. Arguments `num_frames`
and `fps` are mutually exclusive.

Args:
    metadata (`VideoMetadata`):
        Metadata of the video containing information about total duration, fps and total number of frames.
    num_frames (`int`, *optional*):
        Maximum number of frames to sample. Defaults to `self.num_frames`.
    fps (`int` or `float`, *optional*):
        Target frames to sample per second. Defaults to `self.fps`.

Returns:
    np.ndarray:
        Indices to sample video frames.
zc`num_frames`, `fps`, and `sample_indices_fn` are mutually exclusive arguments, please use only one!zÈAsked to sample `fps` frames per second but no video metadata was provided which is required when sampling with `fps`. Please pass in `VideoMetadata` object or use a fixed `num_frames` per input videoz(Video can't be sampled. The `num_frames=z` exceeds `total_num_frames=z`. )Ú
ValueErrorrZ   r[   Útotal_num_framesr\   ÚtorchÚarange)r?   rY   rZ   r[   r3   r`   Úindicess   &&&&,  r7   Úsample_framesÚ BaseVideoProcessor.sample_frames‡   s
  € ð0 Š?˜zÒ5ÜØuóð ð $.Ò#9‘Z¸t¿¹ˆ
Ø’_‰c¨$¯(©(ˆØ#×4Ñ4Ðð Ò #¢/ØÒ 8§<¡<Ò#7Ü ðhóð ô Ð-·±Õ<¸sÕBÓCˆJàÔ(ÜØ:¸:¸,ÐFbÐcsÐbtÐtwÐxóð ð Ò!Ü—l’l 1Ð&6È:Õ8UÓV×ZÑZÓ\ˆGð ˆô —l’l 1Ð&6Ó7×;Ñ;Ó=ˆGØˆr:   c                ór   <€ V ^8„  d   QhRS[ RS[S[,          RS[R,          RS[R,          RS[R,          /# )r2   rG   Úvideo_metadataÚdo_sample_framesNÚsample_indices_fnr4   rL   )r"   r#   ÚdictÚboolr   Úlist)r5   r6   s   "€r7   r8   r9   ¼   sO   ø€ ÷ &&ñ &&áð&&ñ &©Õ,ð&&ñ  �+ð	&&ñ
 $ d�?ð&&ñ 
ˆnÕ	ñ&&r:   c                ó¤  € \        V4      p\        WR7      p\        V^ ,          4      '       d_   V'       dW   . p. p\        W4       F<  w  rxV! VR7      p	W˜n        VP                  Wy,          4       VP                  V4       K>  	  TpTpW3# \        V^ ,          4      '       gŸ   \        V^ ,          \        4      '       dn   V P                  V4       U
Uu. uF9  p
\        P                  ! V
 Uu. uF  q°P                  V4      NK  	  up^ R7      NK;  	  pp
pV'       d   \        R4      h W3# V P                  WR7      w  rW3# u upi u upp
i )z2
Decode input videos and sample frames if needed.
)rg   )rY   )ÚdimzUSampling frames from a list of images is not supported! Set `do_sample_frames=False`.©ri   )r*   r)   r'   ÚzipÚframes_indicesÚappendÚ
isinstancerl   Úfetch_imagesra   ÚstackÚprocess_imager_   Úfetch_videos)r?   rG   rg   rh   ri   Úsampled_videosÚsampled_metadatarK   rY   rc   ÚimagesÚimages   &&&&&       r7   Ú_decode_and_sample_videosÚ,BaseVideoProcessor._decode_and_sample_videos¼   sQ  € ô % VÓ,ˆÜ.¨vÔUˆô ˜& �)×$Ò$×)9ØˆNØ!ÐÜ#& vÖ#>‘�Ù+°XÔ>�Ø*1Ô'Ø×%Ñ% e¥nÔ5Ø ×'Ñ'¨Ö1ñ	 $?ð
 $ˆFØ-ˆNð Ð%Ð%ô    q¥	×*Ò*Ü˜& �)¤T×*Ò*ð #'×"3Ñ"3°FÔ";ôá";˜ô —K’KÉÓ OÉ¸u×!3Ñ!3°EÖ!:ÉÑ OÐUV×WÙ";ð ñ ÷ $Ü$Øoóð ð $ð Ð%Ð%ð *.×):Ñ):¸6Ð):Ó)gÑ&�àÐ%Ð%ùò !Pùós   ÃEÃ0EÄ	EÅEc          	      ól   <€ V ^8„  d   QhRS[ RS[S[,          R,          RS[R,          RS[R,          /# )r2   rG   Úinput_data_formatNÚdevicer4   rL   )r"   Ústrr   rl   )r5   r6   s   "€r7   r8   r9   ä   sG   ø€ ÷  ñ  áð ñ Ñ!1Õ1°DÕ8ð ñ �d•
ð	 ñ
 
ˆnÕ	ñ r:   c                ó|  € . pV F³  p\        V\        P                  4      '       d%   \        P                  ! V4      P                  4       pVf   \        V4      pV\        P                  8X  d#   VP                  ^ ^^^4      P                  4       pVe   VP                  V4      pVP                  V4       Kµ  	  V# )z*
Prepare the input videos for processing.
)rs   ÚnpÚndarrayra   Ú
from_numpyÚ
contiguousr%   r   ÚLASTÚpermuteÚtorr   )r?   rG   r   r€   Úprocessed_videosrK   s   &&&&  r7   Ú_prepare_input_videosÚ(BaseVideoProcessor._prepare_input_videosä   s§   € ð ÐÛˆEä˜%¤§¡×,Ò,ä×(Ò(¨Ó/×:Ñ:Ó<�ð !Ò(Ü$BÀ5Ó$IÐ!à Ô$4×$9Ñ$9Ô9ØŸ™ a¨¨A¨qÓ1×<Ñ<Ó>�àÒ!ØŸ™ Ó(�à×#Ñ# EÖ*ñ! ð"  Ðr:   c                ó<   <€ V ^8„  d   QhRS[ RS[S[,          RS[/# )r2   rG   r3   r4   )r"   r   r   r   )r5   r6   s   "€r7   r8   r9     s.   ø€ ÷ *#ñ *#áð*#ñ ™Õ&ð*#ñ 
ñ	*#r:   c           	     ó(  € \        VP                  4       \        V P                  P                  P                  4       4      R .,           R7       \        V P                  V4       V P                  P                   F  pVP                  V\        WR4      4       K!  	  VP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      pV'       d   \        V P                  3/ VB MRpV P                  VVVVR7      w  rV P                  WVR7      pV P                  ! R/ VB pV P                  ! R/ VB  VP                  R	4       VP                  R
4      p	V P                  ! RRV/VB p
V	'       d   WzR&   V
# )Úreturn_tensors)Úcaptured_kwargsÚvalid_processor_keysNr   rh   r€   rg   )rg   rh   ri   )rG   r   r€   Údata_formatÚreturn_metadatarG   r<   )r   Úkeysrl   Úvalid_kwargsÚ__annotations__r   Ú
setdefaultÚgetattrÚpopr   rd   r|   r‹   Ú_standardize_kwargsÚ_validate_preprocess_kwargsÚ_preprocess)r?   rG   r3   Ú
kwarg_namer   rh   r€   rg   ri   r“   Úpreprocessed_videoss   &&,        r7   rF   ÚBaseVideoProcessor.preprocess  s  € ô 	Ø"ŸK™K›MÜ!% d×&7Ñ&7×&GÑ&G×&LÑ&LÓ&NÓ!OÐScÐRdÕ!dõ	
ô 	˜D×-Ñ-¨vÔ6ð ×+Ñ+×;Ô;ˆJØ×Ñ˜j¬'°$ÀDÓ*IÖJñ <ð #ŸJ™JÐ':Ó;ÐØ!Ÿ:™:Ð&8Ó9ÐØ—‘˜HÓ%ˆØŸ™Ð$4Ó5ˆçEUœG D×$6Ñ$6ÑA¸&ÒAÐ[_ÐØ!%×!?Ñ!?ØØ)Ø-Ø/ð	 "@ó "
Ñˆð ×+Ñ+°6ÐgmÐ+Ónˆà×)Ò)Ñ3¨FÑ3ˆØ×(Ò(Ñ2¨6Ò2ð 	�
‰
�=Ô!Ø Ÿ*™*Ð%6Ó7ˆà"×.Ò.ÑG°fÐGÀÑGÐßØ4BÐ 0Ñ1Ø"Ð"r:   c                óô   <€ V ^8„  d   QhRS[ R,          RS[RS[RS[RRRS[R	S[R
S[RS[RS[RS[S[ S[,          ,          R,          RS[S[ S[,          ,          R,          RS[S[,          R,          RS[/# )r2   rG   rL   Údo_convert_rgbÚ	do_resizeÚsizeÚresamplez7PILImageResampling | tvF.InterpolationMode | int | NoneÚdo_center_cropÚ	crop_sizeÚ
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanNÚ	image_stdr�   r4   )rl   rk   r   r]   r�   r   r   )r5   r6   s   "€r7   r8   r9   .  sÓ   ø€ ÷ +hñ +há�^Õ$ð+hñ ð+hñ ð	+hñ
 ð+hð Lð+hñ ð+hñ ð+hñ ð+hñ ð+hñ ð+hñ ™D¡�KÕ'¨$Õ.ð+hñ ™4¡�;Õ&¨Õ-ð+hñ ™jÕ(¨4Õ/ð+hñ  
ñ!+hr:   c           	     óÐ  € \        V4      w  pp/ pVP                  4        F?  w  ppV'       d   V P                  V4      pV'       d   V P                  VWER 7      pVVV&   KA  	  \	        VV4      p\        V4      w  pp/ pVP                  4        F9  w  ppV'       d   V P                  VV4      pV P                  VW‰W«V4      pVVV&   K;  	  \	        VV4      p\        RV/VR7      # ))r£   r¤   r0   )ÚdataÚtensor_type)r$   ÚitemsrV   Úresizer+   Úcenter_cropÚrescale_and_normalizer   )r?   rG   r¡   r¢   r£   r¤   r¥   r¦   r§   r¨   r©   rª   r«   r�   r3   Úgrouped_videosÚgrouped_videos_indexÚresized_videos_groupedrS   Ústacked_videosÚresized_videosÚprocessed_videos_groupedrŠ   s   &&&&&&&&&&&&&&,        r7   rœ   ÚBaseVideoProcessor._preprocess.  s	  € ô$ 0EÀVÓ/LÑ,ˆÐ,Ø!#ÐØ%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%×!4Ñ!4°^Ó!D�ßØ!%§¡¨^À$ Ó!Z�Ø,:Ð" 5Ó)ñ &<ô (Ð(>Ð@TÓUˆô 0EÀ^Ó/TÑ,ˆÐ,Ø#%Ð Ø%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%×!1Ñ!1°.À)Ó!L�à!×7Ñ7Ø 
¸LÐV_óˆNð /=Ð$ UÓ+ñ &<ô *Ð*BÐDXÓYÐäÐ"7Ð9IÐ!JÐXfÔgÐgr:   c                ó²   <€ V ^8„  d   QhRS[ S[P                  ,          RS[ S[P                  ,          R,          RS[RS[RS[ S[,          R,          RS[ /# )r2   Úpretrained_model_name_or_pathÚ	cache_dirNÚforce_downloadÚlocal_files_onlyÚtokenÚrevision©r�   ÚosÚPathLikerk   )r5   r6   s   "€r7   r8   r9   \  so   ø€ ÷ `=ñ `=á'*©R¯[©[Õ'8ð`=ñ ™Ÿ™Õ$ tÕ+ð`=ñ ð	`=ñ
 ð`=ñ ‘T�z˜DÕ ð`=ñ ñ`=r:   c                ó‚   € W'R&   W7R&   WGR&   WgR&   Ve   WWR&   V P                   ! V3/ VB w  r‡V P                  ! V3/ VB # )aC  
Instantiate a type of [`~video_processing_utils.VideoProcessorBase`] from an video processor.

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

        - a string, the *model id* of a pretrained video hosted inside a model repo on
          huggingface.co.
        - a path to a *directory* containing a video processor file saved using the
          [`~video_processing_utils.VideoProcessorBase.save_pretrained`] method, e.g.,
          `./my_model_directory/`.
        - a path to a saved video processor JSON *file*, e.g.,
          `./my_model_directory/video_preprocessor_config.json`.
    cache_dir (`str` or `os.PathLike`, *optional*):
        Path to a directory in which a downloaded pretrained model video 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 video 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`, 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 video processor object. If `True`, then this
        functions returns a `Tuple(video_processor, unused_kwargs)` where *unused_kwargs* is a dictionary
        consisting of the key/value pairs whose keys are not video processor attributes: i.e., the part of
        `kwargs` which has not been used to update `video_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 video processor attributes will be used to override the
        loaded values. Behavior concerning key/value pairs whose keys are *not* video processor attributes is
        controlled by the `return_unused_kwargs` keyword parameter.

Returns:
    A video processor of type [`~video_processing_utils.ImagVideoProcessorBase`].

Examples:

```python
# We can't instantiate directly the base class *VideoProcessorBase* so let's show the examples on a
# derived class: *LlavaOnevisionVideoProcessor*
video_processor = LlavaOnevisionVideoProcessor.from_pretrained(
    "llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
)  # Download video_processing_config from huggingface.co and cache.
video_processor = LlavaOnevisionVideoProcessor.from_pretrained(
    "./test/saved_model/"
)  # E.g. video processor (or model) was saved using *save_pretrained('./test/saved_model/')*
video_processor = LlavaOnevisionVideoProcessor.from_pretrained("./test/saved_model/video_preprocessor_config.json")
video_processor = LlavaOnevisionVideoProcessor.from_pretrained(
    "llava-hf/llava-onevision-qwen2-0.5b-ov-hf", do_normalize=False, foo=False
)
assert video_processor.do_normalize is False
video_processor, unused_kwargs = LlavaOnevisionVideoProcessor.from_pretrained(
    "llava-hf/llava-onevision-qwen2-0.5b-ov-hf", do_normalize=False, foo=False, return_unused_kwargs=True
)
assert video_processor.do_normalize is False
assert unused_kwargs == {"foo": False}
```r¼   r½   r¾   rÀ   r¿   )Úget_video_processor_dictÚ	from_dict)	Úclsr»   r¼   r½   r¾   r¿   rÀ   r3   Úvideo_processor_dicts	   &&&&&&&, r7   Úfrom_pretrainedÚ"BaseVideoProcessor.from_pretrained[  sd   € ðn (ˆ{ÑØ#1ÐÑ Ø%5Ð!Ñ"Ø%ˆzÑàÒØ#�7‰Oà'*×'CÒ'CÐDaÑ'lÐekÑ'lÑ$Ðà�}Š}Ð1Ñ<°VÑ<Ð<r:   c                óJ   <€ V ^8„  d   QhRS[ S[P                  ,          RS[/# )r2   Úsave_directoryÚpush_to_hubrÁ   )r5   r6   s   "€r7   r8   r9   ¾  s$   ø€ ÷ .-ñ .-©c±B·K±KÕ.?ð .-Édñ .-r:   c           	     óî  € \         P                  P                  V4      '       d   \        RV R24      h\         P                  ! VRR7       V'       d‹   VP                  RR4      pVP                  RVP                  \         P                  P                  4      R,          4      p\        4       P                  ! V3RR/VB P                  pV P                  V4      pV P                  e   \        WV R	7       \         P                  P                  V\        4      pV P!                  V4       \"        P%                  R
V 24       V'       d&   V P'                  VXXXVP)                  R4      R7       V.# )a  
Save an video processor object to the directory `save_directory`, so that it can be re-loaded using the
[`~video_processing_utils.VideoProcessorBase.from_pretrained`] class method.

Args:
    save_directory (`str` or `os.PathLike`):
        Directory where the video 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.
zProvided path (z#) should be a directory, not a fileT)Úexist_okÚcommit_messageNÚrepo_idrÏ   )ÚconfigzVideo processor saved in r¿   )rÐ   r¿   éÿÿÿÿ)rÂ   ÚpathÚisfileÚAssertionErrorÚmakedirsr™   ÚsplitÚsepr   Úcreate_reporÑ   Ú_get_files_timestampsÚ_auto_classr   Újoinr   Úto_json_fileÚloggerÚinfoÚ_upload_modified_filesÚget)r?   rÌ   rÍ   r3   rÐ   rÑ   Úfiles_timestampsÚoutput_video_processor_files   &&&,    r7   Úsave_pretrainedÚ"BaseVideoProcessor.save_pretrained¾  s8  € ô �7‰7�>‰>˜.×)Ò)Ü  ?°>Ð2BÐBeÐ!fÓgÐgä
�Š�N¨TÕ2çØ#ŸZ™ZÐ(8¸$Ó?ˆNØ—j‘j ¨N×,@Ñ,@ÄÇÁÇÁÓ,MÈbÕ,QÓRˆGÜ“h×*Ò*¨7ÑL¸TÐLÀVÑL×TÑTˆGØ#×9Ñ9¸.ÓIÐð ×ÑÒ'Ü˜t¸DÕAô ')§g¡g§l¡l°>ÔCWÓ&XÐ#à×ÑÐ5Ô6Ü�‰Ð/Ð0KÐ/LÐMÔNçØ×'Ñ'ØØØ Ø-Ø—j‘j Ó)ð (ô ð ,Ð,Ð,r:   c                óŒ   <€ V ^8„  d   QhRS[ S[P                  ,          RS[S[S[ S[3,          S[S[ S[3,          3,          /# )r2   r»   r4   )r�   rÂ   rÃ   Útuplerj   r   )r5   r6   s   "€r7   r8   r9   ï  sD   ø€ ÷ {,ñ {,Ù,/±"·+±+Õ,=ð{,á	‰t‘C™�H�~™t¡C© H�~Ð-Õ	.ñ{,r:   c                óÆ  € VP                  RR4      pVP                  RR4      pVP                  RR4      pVP                  RR4      pVP                  RR4      pVP                  RR4      pVP                  R	R
4      p	VP                  RR4      p
VP                  RR4      pRRRV/pV
e   W¬R&   \        4       '       d    V'       g   \        P                  R4       Rp\	        V4      p\
        P                  P                  V4      p\
        P                  P                  V4      '       d   TpRpRpMi\        p \        V\        VVVVVVVV	RR7      pV\        3 Uu. uF#  p\        VVVVVVVVVV	RR7      ;p  f   K!  VNK%  	  ppV'       d
   V^ ,          MRpRpVe   \        V4      pRV9   d
   VR,          pVe   Vf   \        V4      pVf   \        RV RV RX R24      hV'       d   \        P                  RV 24       VV3# \        P                  RX RV 24       VV3# u upi   \         d    h \         d    \        RT RT RT R24      hi ; i)a¶  
From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a
video processor of type [`~video_processing_utils.VideoProcessorBase`] 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.

Returns:
    `tuple[Dict, Dict]`: The dictionary(ies) that will be used to instantiate the video processor object.
r¼   Nr½   FÚproxiesr¿   r¾   rÀ   Ú	subfolderÚ Ú_from_pipelineÚ
_from_autoÚ	file_typeúvideo processorÚfrom_auto_classÚusing_pipelinez+Offline mode: forcing local_files_only=TrueT)
Úfilenamer¼   r½   rê   r¾   r¿   Ú
user_agentrÀ   rë   Ú%_raise_exceptions_for_missing_entriesz Can't load video 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Úvideo_processorzloading configuration file z from cache at )r™   r   rß   rà   r�   rÂ   rÔ   ÚisdirrÕ   r   r   r   r   ÚOSErrorÚ	Exceptionr   )rÇ   r»   r3   r¼   r½   rê   r¿   r¾   rÀ   rë   Úfrom_pipelinerñ   rô   Úis_localÚresolved_video_processor_fileÚresolved_processor_fileÚvideo_processor_fileró   Úresolved_fileÚresolved_video_processor_filesrÈ   Úprocessor_dicts   &&,                   r7   rÅ   Ú+BaseVideoProcessor.get_video_processor_dictî  sÿ  € ð$ —J‘J˜{¨DÓ1ˆ	ØŸ™Ð$4°eÓ<ˆØ—*‘*˜Y¨Ó-ˆØ—
‘
˜7 DÓ)ˆØ!Ÿ:™:Ð&8¸%Ó@ÐØ—:‘:˜j¨$Ó/ˆØ—J‘J˜{¨BÓ/ˆ	àŸ
™
Ð#3°TÓ:ˆØ Ÿ*™* \°5Ó9ˆà!Ð#4Ð6GÈÐYˆ
ØÒ$Ø+8Ð'Ñ(ä×Ò×%5Ü�K‰KÐEÔFØ#Ðä(+Ð,IÓ(JÐ%Ü—7‘7—=‘=Ð!>Ó?ˆÜ�7‰7�>‰>Ð7×8Ò8Ø,IÐ)Ø&*Ð#Ø‰Hä#7Ð ð2ô +6Ø1Ü+Ø'Ø#1Ø#Ø%5ØØ)Ø%Ø'Ø:?ô+Ð'ð &:Ô;OÑ$Pó2á$P˜ä)4Ø9Ø%-Ø&/Ø+9Ø$+Ø-=Ø"'Ø'1Ø%-Ø&/ØBGô*ð ˜ð  ð ÷ "�MÙ$Pð /ð 2÷* :XÐ2°1Ö5Ð]að .ð&  $ÐØ"Ò.Ü0Ð1HÓIˆNØ  NÔ2Ø'5Ð6GÕ'HÐ$à(Ò4Ð9MÒ9UÜ#6Ð7TÓ#UÐ àÒ'ÜØ2Ð3PÐ2Qð R5à5RÐ4Sð T+Ø+?Ð*@ÀðGóð ÷ Ü�K‰KÐ5Ð6SÐ5TÐUÔVð $ VÐ+Ð+ô	 �K‰KØ-Ð.BÐ-CÀ?ÐSpÐRqÐrôð $ VÐ+Ð+ùò2øô. ô ð Üô äØ6Ð7TÐ6Uð V9à9VÐ8Wð X/Ø/CÐ.DÀEðKóð ðús*   Ä=$H4 Å!H/ÆH/Æ
H4 È/H4 È4I É	I c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r2   rÈ   ©rj   r�   r   )r5   r6   s   "€r7   r8   r9   m  s   ø€ ÷ &#ñ &#©T±#±s°(­^ñ &#r:   c           	     ó´  € VP                  4       pVP                  RR4      pTP                  VP                  4        UUu/ uF#  w  rEW@P                  P
                  9   g   K!  WEbK%  	  upp4       V ! R/ VB p. p\        \        VP                  4       4      4       F_  p\        Wh4      '       g   K  W€P                  P
                  9  g   K2  \        WhVP                  VR4      4       VP                  V4       Ka  	  V'       d'   \        P                  RV P                   RV R24       \        P                  RV 24       V'       d   Wb3# V# u uppi )	a‡  
Instantiates a type of [`~video_processing_utils.VideoProcessorBase`] from a Python dictionary of parameters.

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

Returns:
    [`~video_processing_utils.VideoProcessorBase`]: The video processor object instantiated from those
    parameters.
Úreturn_unused_kwargsFNzImage processor z	: kwargs zÍ were applied for backward compatibility. To avoid this warning, add them to valid_kwargs: create a custom TypedDict extending ImagesKwargs with these keys and set it as the `valid_kwargs` class attribute.zVideo processor r<   )Úcopyr™   Úupdater¯   r•   r–   Úreversedrl   r”   ÚhasattrÚsetattrrr   rß   Úwarning_onceÚ__name__rà   )	rÇ   rÈ   r3   r  ÚkÚvrö   Ú
extra_keysÚkeys	   &&,      r7   rÆ   ÚBaseVideoProcessor.from_dictl  s-  € ð"  4×8Ñ8Ó:ÐØ%Ÿz™zÐ*@À%ÓHÐØ×#Ñ#°f·l±l´nÔ$n±n©d¨aÈ×M]ÑM]×MmÑMmÑHm¤T Q¢T±nÒ$nÔoÙÑ5Ð 4Ñ5ˆð ˆ
ÜœD §¡£Ó/Ö0ˆCÜ�×,Ô,°×<LÑ<L×<\Ñ<\Ö1\Ü˜¨f¯j©j¸¸dÓ.CÔDØ×!Ñ! #Ö&ñ 1÷ Ü×ÑØ" 3§<¡< .°	¸*¸ð Fað bôô 	�‰Ð& Ð&7Ð8Ô9ßØ"Ð*Ð*à"Ð"ùó) %os   ÁE
Á$E
c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# rC   r  )r5   r6   s   "€r7   r8   r9   •  s   ø€ ÷ ñ ™™c¡3˜h�ñ r:   c                óz   <€ \         SV `  4       pVP                  RR4       V P                  P                  VR&   V# )zŸ
Serializes this instance to a Python dictionary.

Returns:
    `dict[str, Any]`: Dictionary of all the attributes that make up this video processor instance.
Úimage_processor_typeNÚvideo_processor_type)r=   Úto_dictr™   r@   r  )r?   Úfiltered_dictr@   s   & €r7   r  ÚBaseVideoProcessor.to_dict•  s=   ø€ ô ™™Ó)ˆØ×ÑÐ0°$Ô7Ø04·±×0GÑ0GˆÐ,Ñ-àÐr:   c                ó    <€ V ^8„  d   QhRS[ /# rC   )r�   )r5   r6   s   "€r7   r8   r9   ¢  s   ø€ ÷ Gñ G¡ñ Gr:   c                óü   € V P                  4       pVP                  4        F9  w  r#\        V\        P                  4      '       g   K'  VP                  4       W&   K;  	  \        P                  ! V^RR7      R,           # )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.
T)ÚindentÚ	sort_keysÚ
)r  r¯   rs   rƒ   r„   ÚtolistÚjsonÚdumps)r?   Ú
dictionaryr  Úvalues   &   r7   Úto_json_stringÚ!BaseVideoProcessor.to_json_string¢  s\   € ð —\‘\“^ˆ
à$×*Ñ*Ö,‰JˆCÜ˜%¤§¡×,Ô,Ø"'§,¡,£.�
“ñ -ô �zŠz˜*¨Q¸$Ô?À$ÕFÐFr:   c                óD   <€ V ^8„  d   QhRS[ S[P                  ,          /# )r2   Újson_file_path©r�   rÂ   rÃ   )r5   r6   s   "€r7   r8   r9   ±  s   ø€ ÷ 	0ñ 	0©3±·±Õ+<ñ 	0r:   c                óª   € \        VRRR7      ;_uu_ 4       pVP                  V P                  4       4       RRR4       R#   + '       g   i     R# ; i)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.
Úwúutf-8©ÚencodingN)ÚopenÚwriter$  )r?   r'  Úwriters   && r7   rÞ   ÚBaseVideoProcessor.to_json_file±  s9   € ô �. #°×8Õ8¸FØ�L‰L˜×,Ñ,Ó.Ô/÷ 9×8×8Ò8ús   — AÁA	c                óT   € V P                   P                   R V P                  4        2# )Ú )r@   r  r$  )r?   s   &r7   Ú__repr__ÚBaseVideoProcessor.__repr__¼  s(   € Ø—.‘.×)Ñ)Ð*¨!¨D×,?Ñ,?Ó,AÐ+BÐCÐCr:   c                óD   <€ V ^8„  d   QhRS[ S[P                  ,          /# )r2   Ú	json_filer(  )r5   r6   s   "€r7   r8   r9   À  s   ø€ ÷ +ñ +¡s©R¯[©[Õ'8ñ +r:   c                óÂ   € \        VRRR7      ;_uu_ 4       pVP                  4       pRRR4       \        P                  ! X4      pV ! R/ VB #   + '       g   i     L.; i)a„  
Instantiates a video processor of type [`~video_processing_utils.VideoProcessorBase`] 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 video processor of type [`~video_processing_utils.VideoProcessorBase`]: The video_processor object
    instantiated from that JSON file.
Úrr+  r,  Nr<   )r.  Úreadr   Úloads)rÇ   r7  ÚreaderÚtextrÈ   s   &&   r7   Úfrom_json_fileÚ!BaseVideoProcessor.from_json_file¿  sL   € ô �)˜S¨7×3Õ3°vØ—;‘;“=ˆD÷ 4ä#Ÿzšz¨$Ó/ÐÙÑ*Ð)Ñ*Ð*÷ 4×3ús   —AÁA	c                ó¦   € \        V\        4      '       g   VP                  p^ RIHu Hp \        W!4      '       g   \        V R24      hWn        R# )aÁ  
Register this class with a given auto class. This should only be used for custom video processors as the ones
in the library are already mapped with `AutoVideoProcessor `.

<Tip warning={true}>

This API is experimental and may have some slight breaking changes in the next releases.

</Tip>

Args:
    auto_class (`str` or `type`, *optional*, defaults to `"AutoVideoProcessor "`):
        The auto class to register this new video processor with.
Nz is not a valid auto class.)	rs   r�   r  Útransformers.models.autoÚmodelsÚautor
  r_   rÜ   )rÇ   Ú
auto_classÚauto_modules   && r7   Úregister_for_auto_classÚ*BaseVideoProcessor.register_for_auto_classÒ  sE   € ô  ˜*¤c×*Ò*Ø#×,Ñ,ˆJç6Ð6ä�{×/Ò/Ü 
˜|Ð+FÐGÓHÐHà$Žr:   c                óp   <€ V ^8„  d   QhRS[ S[S[ ,          ,          S[S[S[ ,          ,          ,          /# )r2   Úvideo_url_or_urls)r�   rl   )r5   r6   s   "€r7   r8   r9   ì  s,   ø€ ÷ gñ g©c±D¹µI­oÁÁTÉ#ÅYÅÕ.Oñ gr:   c                óL  € Rp\        4       '       g;   \        4       '       g   \        R\         24      h\        P
                  ! R4       Rp\        V\        4      '       d2   \        \        V Uu. uF  q@P                  WBR7      NK  	  up!  4      # \        WVR7      # u upi )zÈ
Convert a single or a list of urls into the corresponding `np.array` 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.
Ú
torchcodeczQ`torchcodec` is not installed and cannot be used to decode the video by default. zÇ`torchcodec` is not installed and cannot be used to decode the video by default. Falling back to `torchvision`. Note that `torchvision` decoding is deprecated and will be removed in future versions. Útorchvisionro   )Úbackendri   )r   r&   ÚImportErrorr!   ÚwarningsÚwarnrs   rl   rp   rw   r(   )r?   rI  ri   rM  Úxs   &&&  r7   rw   ÚBaseVideoProcessor.fetch_videosì  s£   € ð ˆÜ&×(Ò(ä:×<Ò<Ü!ØgÜ7Ð8ð:óð ô �MŠMðIôð $ˆGäÐ'¬×.Ò.ÜœÑarÓsÑarÐ\]×/Ñ/°Ð/ÖWÑarÑsÑtÓuÐuäÐ/ÐTeÔfÐfùò ts   Á1B!r<   gp?)NNrE   )NFFNÚmain)F)ÚAutoVideoProcessor)2r  Ú
__module__Ú__qualname__Ú__firstlineno__rÜ   r¤   rª   r«   r£   Úsize_divisorÚdefault_to_squarer¦   r¢   r¥   r§   r¨   r©   r¡   rh   r[   rZ   rg   r“   r   r•   Úmodel_input_namesr>   rH   rV   rd   r|   r‹   r   rF   rœ   ÚclassmethodrÉ   rå   rÅ   rÆ   r  r$  rÞ   r4  r>  rF  rw   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r@   r6   s   @@r7   r/   r/   O   sˆ  ù‡ € à€Kà€HØ€JØ€IØ€DØ€LØÐØ€IØ€IØ€NØ€JØ€NØ€LØ€NØÐØ
€CØ€JØ€NØ€OØ€LØ.Ð/Ð÷#ó #÷1ð 1÷ð ÷23ò 3÷j&&ò &&÷P ò  ð: ÷*#ó ð*#÷X+hò +hðZ ÷`=ñ `=ó ð`=÷D.-ò .-ð` ÷{,ó ð{,ðz ÷&#ó ð&#÷Pó ÷Gð G÷	0ð 	0òDð ÷+ó ð+ð$ ó%ó ð%÷2g÷ gò gr:   r/   rð   rT  zvideo processor file)ÚobjectÚobject_classÚobject_files)ÚvisionrL  )Hr   rÂ   rO  Úcollections.abcr   Ú	functoolsr   Útypingr   Únumpyrƒ   Úhuggingface_hubr   Úhuggingface_hub.dataclassesr   Údynamic_module_utilsr   Úimage_processing_backendsr	   Úimage_processing_utilsr   Úimage_utilsr   r   r   r   Úprocessing_utilsr   r   Úutilsr   r   r   r   r   r   r   r   r   r   r   Ú	utils.hubr   r   Úutils.import_utilsr    Úvideo_utilsr!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   ra   Ú$torchvision.transforms.v2.functionalÚ
transformsÚv2Ú
functionalrQ   r,   Ú
get_loggerr  rß   r/   rÍ   Ú__doc__r5   r<   r:   r7   Ú<module>rx     s1  ðó Û 	Û Ý $Ý Ý ã Ý +Ý ;å 4Ý 9Ý 0÷ó ÷ 3÷÷ ÷ ñ ÷ +Ý (÷÷ ÷ ñ ñ ×ÒÛá× Ò ß6Ó6á×ÒÝ/ð 
×	Ò	˜HÓ	%€ñ 
Ð,Ô-ôt
gÐ+ó t
gó .ðt
gñn "+Ð+=×+IÑ+IÓ!JÐ Ô Ø×!Ñ!×)Ñ)Ò5Ø-?×-KÑ-K×-SÑ-S×-ZÑ-ZØ Ð/CÐRhð .[ó .Ð×"Ñ"Ö*ñ 6r:   