+
    œ°³jH,  ã                   ó  € ^ RI t ^ RIHt ^ RIHt ^ RIt^RIHt ^RIH	t	 ^RI
HtHt ^RIHtHtHtHt ^RIHt ^R	IHtHtHt ^R
IHt ]'       d   ^RIHt ^ RIHt R R lt ! R R]RR7      t ] ! R R]4      4       t!R.t"R# )é    N)ÚIterable)ÚTYPE_CHECKING)ÚTorchvisionBackend)ÚBatchFeature)Úgroup_images_by_shapeÚreorder_images)ÚIMAGENET_STANDARD_MEANÚIMAGENET_STANDARD_STDÚPILImageResamplingÚSizeDict)ÚImagesKwargs)Ú
TensorTypeÚauto_docstringÚrequires_backends)ÚBeitImageProcessor)ÚDepthEstimatorOutput)Ú
functionalc          
      óx   € V ^8„  d   QhRRR\         \        \         ,          ,          R\        R\         R\        /# )é   Úinput_imageútorch.TensorÚoutput_sizeÚkeep_aspect_ratioÚmultipleÚreturn)Úintr   Úboolr   )Úformats   "Úd/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/dpt/modular_dpt.pyÚ__annotate__r    *   sC   € ÷ $8ñ $8Øð$8ä”x¤•}Õ$ð$8ô ð$8ô ð	$8ô
 ñ$8ó    c                 ó  € RR lpV P                   RR w  rVVw  rxWu,          p	W†,          p
V'       d-   \        ^V
,
          4      \        ^V	,
          4      8  d   T
p	MT	p
V! W•,          VR7      pV! W¦,          VR7      p\        W¼R7      # )r   Nc                 óâ   € \        W,          4      V,          pVe*   WC8”  d$   \        P                  ! W,          4      V,          pWB8  d$   \        P                  ! W,          4      V,          pV# ©N)ÚroundÚmathÚfloorÚceil)Úvalr   Úmin_valÚmax_valÚxs   &&&& r   Úconstrain_to_multiple_ofÚ>get_resize_output_image_size.<locals>.constrain_to_multiple_of0   sQ   € Ü�#•.Ó! HÕ,ˆàÒ 1¤;Ü—
’
˜3�>Ó*¨XÕ5ˆAàŒ;Ü—	’	˜#�.Ó)¨HÕ4ˆAàˆr!   )r   )ÚheightÚwidth)r   Néþÿÿÿ)ÚshapeÚabsr   )r   r   r   r   r-   Úinput_heightÚinput_widthÚoutput_heightÚoutput_widthÚscale_heightÚscale_widthÚ
new_heightÚ	new_widths   &&&&         r   Úget_resize_output_image_sizer<   *   sŒ   € ô	ð !,× 1Ñ 1°"°#Ð 6Ñ€LØ"-Ñ€Mð !Õ/€LØÕ,€Kçäˆq�;�Ó¤# a¨,Õ&6Ó"7Ô7à&‰Lð 'ˆKá)¨,Õ*EÐPXÔY€JÙ(¨Õ)BÈXÔV€Iä˜:Ô7Ð7r!   c                   ó0   a € ] tR t^Qt o RtV 3R ltRtV tR# )ÚDPTImageProcessorKwargsa  
ensure_multiple_of (`int`, *optional*, defaults to 1):
    If `do_resize` is `True`, the image is resized to a size that is a multiple of this value. Can be overridden
    by `ensure_multiple_of` in `preprocess`.
keep_aspect_ratio (`bool`, *optional*, defaults to `False`):
    If `True`, the image is resized to the largest possible size such that the aspect ratio is preserved. Can
    be overridden by `keep_aspect_ratio` in `preprocess`.
do_reduce_labels (`bool`, *optional*, defaults to `self.do_reduce_labels`):
    Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0
    is used for background, and background itself is not included in all classes of a dataset (e.g.
    ADE20k). The background label will be replaced by 255.
c                óJ   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[;R&   S[;R&   # )r   Úensure_multiple_ofÚsize_divisorr   Údo_reduce_labels)r   r   )r   Ú__classdict__s   "€r   r    Ú$DPTImageProcessorKwargs.__annotate__Q   s9   ø‡ ‚ ñ Ññ ñ Ññ ñ  Ññ! ñ" Ñò# r!   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©rC   s   @r   r>   r>   Q   s   ø‡ € ñ÷ ƒ r!   r>   F)Útotalc                   óÌ   a € ] tR t^et o ]P
                  t]t]	t
RRRR/tRtRtRtRtRt^tRtRtRtRt]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tRV 3R lR lltRtV tR# )ÚDPTImageProcessorr/   i€  r0   TFNc                óL   <€ V ^8„  d   QhRRRS[ RRRS[RS[R,          R	S[R
R/# )r   Úimager   ÚsizeÚresampleú7PILImageResampling | tvF.InterpolationMode | int | NoneÚ	antialiasr@   Nr   r   )r   r   r   )r   rC   s   "€r   r    ÚDPTImageProcessor.__annotate__z   s_   ø€ ÷ &kñ &kàð&kñ ð&kð Lð	&kñ
 ð&kñ   $�Jð&kñ  ð&kð 
ñ&kr!   c                óþ   € VP                   '       d   VP                  '       g   \        RVP                  4        24      h\	        VVP                   VP                  3VVR7      p\
        P                  ! WWsVR7      # )a´  
Resize an image to `(size["height"], size["width"])`.

Args:
    image (`torch.Tensor`):
        Image to resize.
    size (`SizeDict`):
        Dictionary in the format `{"height": int, "width": int}` specifying the size of the output image.
    interpolation (`InterpolationMode`, *optional*, defaults to `InterpolationMode.BILINEAR`):
        `InterpolationMode` filter to use when resizing the image e.g. `InterpolationMode.BICUBIC`.
    antialias (`bool`, *optional*, defaults to `True`):
        Whether to use antialiasing when resizing the image
    ensure_multiple_of (`int`, *optional*):
        If `do_resize` is `True`, the image is resized to a size that is a multiple of this value
    keep_aspect_ratio (`bool`, *optional*, defaults to `False`):
        If `True`, and `do_resize` is `True`, the image is resized to the largest possible size such that the aspect ratio is preserved.

Returns:
    `torch.Tensor`: The resized image.
zDThe size dictionary must contain the keys 'height' and 'width'. Got )r   r   r   )rU   rW   )r/   r0   Ú
ValueErrorÚkeysr<   r   Úresize)ÚselfrS   rT   rU   rW   r@   r   r   s   &&&&&&& r   r\   ÚDPTImageProcessor.resizez   sn   € ð: �{�{ˆ{ $§*§* *ÜÐcÐdh×dmÑdmÓdoÐcpÐqÓrÐrä2ØØŸ™ d§j¡jÐ1Ø/Ø'ô	
ˆô "×(Ò(¨°kÐ`iÔjÐjr!   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# )r   rS   r   rA   r   )r   )r   rC   s   "€r   r    rX   ¢   s)   ø€ ÷ 'ñ 'àð'ñ ð'ð 
ñ	'r!   c                ó†   € VP                   RR w  r4R pV! W24      w  rgV! WB4      w  r‰W†W—3p
\        P                  ! W4      # )aL  
Center pad a batch of images to be a multiple of `size_divisor`.

Args:
    image (`torch.Tensor`):
        Image to pad.  Can be a batch of images of dimensions (N, C, H, W) or a single image of dimensions (C, H, W).
    size_divisor (`int`):
        The width and height of the image will be padded to a multiple of this number.
Nc                 ó€   € \         P                  ! W,          4      V,          pW ,
          pV^,          pW4,
          pWE3# )r   )r&   r(   )rT   rA   Únew_sizeÚpad_sizeÚpad_size_leftÚpad_size_rights   &&    r   Ú_get_padÚ-DPTImageProcessor.pad_image.<locals>._get_pad²   s9   € Ü—y’y Õ!4Ó5¸ÕDˆHØ•ˆHØ$¨�MˆMØ%Õ5ˆNØ Ð0Ð0r!   r1   )r2   ÚtvFÚpad)r]   rS   rA   r/   r0   rf   Úpad_topÚ
pad_bottomÚpad_leftÚ	pad_rightÚpaddings   &&&        r   Ú	pad_imageÚDPTImageProcessor.pad_image¢   sP   € ð Ÿ™ B CÐ(‰ˆò	1ñ ' vÓ<ÑˆÙ& uÓ;ÑˆØ iÐ<ˆÜ�wŠw�uÓ&Ð&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[RS[R,          RS[RS[R,          RS[R,          RS[/# )r   Úimagesr   rB   Ú	do_resizerT   rU   rV   Údo_center_cropÚ	crop_sizeÚ
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanNÚ	image_stdr   r@   Údo_padrA   Údisable_groupingr   )Úlistr   r   Úfloatr   r   )r   rC   s   "€r   r    rX   ¾   sí   ø€ ÷ 8 ñ 8 á�^Õ$ð8 ñ ð8 ñ ð	8 ñ
 ð8 ð Lð8 ñ ð8 ñ ð8 ñ ð8 ñ ð8 ñ ð8 ñ ™D¡�KÕ'¨$Õ.ð8 ñ ™4¡�;Õ&¨Õ-ð8 ñ  ð8 ñ   $�Jð8 ñ  ð!8 ñ" ˜D•jð#8 ñ$  �+ð%8 ñ( 
ñ)8 r!   c           	     óø  € V'       d   V P                  V4      p\        VVR 7      w  pp/ pVP                  4        F)  w  ppV'       d   V P                  VVVVVR7      pVVV&   K+  	  \	        VV4      p\        VVR 7      w  pp/ pVP                  4        FS  w  ppV'       d   V P                  VV4      pV P                  VW‰W«V4      pV'       d   V P                  VV4      pVVV&   KU  	  \	        VV4      pV# ))r|   )rS   rT   rU   r@   r   )Úreduce_labelr   Úitemsr\   r   Úcenter_cropÚrescale_and_normalizero   )r]   rr   rB   rs   rT   rU   rt   ru   rv   rw   rx   ry   rz   r   r@   r{   rA   r|   ÚkwargsÚgrouped_imagesÚgrouped_images_indexÚresized_images_groupedr2   Ústacked_imagesÚresized_imagesÚprocessed_images_groupedÚprocessed_imagess   &&&&&&&&&&&&&&&&&&,        r   Ú_preprocessÚDPTImageProcessor._preprocess¾   s'  € ÷* Ø×&Ñ& vÓ.ˆFô 0EÀVÐ^nÔ/oÑ,ˆÐ,Ø!#ÐØ%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%§¡Ø(ØØ%Ø'9Ø&7ð "-ó "�ð -;Ð" 5Ó)ñ &<ô (Ð(>Ð@TÓUˆô 0EÀ^ÐfvÔ/wÑ,ˆÐ,Ø#%Ð Ø%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%×!1Ñ!1°.À)Ó!L�à!×7Ñ7Ø 
¸LÐV_óˆN÷ Ø!%§¡°ÀÓ!M�Ø.<Ð$ UÓ+ñ &<ô *Ð*BÐDXÓYÐàÐr!   c          	      ó¢   <€ V ^8„  d   QhRRRS[ S[S[S[S[3,          ,          ,          R,          R,          RS[S[S[S[ 3,          ,          /# )r   Úoutputsr   Útarget_sizesNr   )r   r}   Útupler   ÚdictÚstr)r   rC   s   "€r   r    rX   ø   sS   ø€ ÷ 'ñ 'à'ð'ñ !¡4©©c±3¨h­Õ#8Õ8¸4Õ?À$ÕFð'ñ 
‰d‘3™
�?Õ#Õ	$ñ	'r!   c                óÄ  € \        V R4       VP                  pVe%   \        V4      \        V4      8w  d   \        R4      h. pVf   R.\        V4      ,          MTp\	        W24       Fu  w  rVVeZ   \
        P                  P                  P                  VP                  ^ 4      P                  ^4      VRRR7      P                  4       pVP                  RV/4       Kw  	  V# )aj  
Converts the raw output of [`DepthEstimatorOutput`] into final depth predictions and depth PIL images.
Only supports PyTorch.

Args:
    outputs ([`DepthEstimatorOutput`]):
        Raw outputs of the model.
    target_sizes (`TensorType` or `List[Tuple[int, int]]`, *optional*):
        Tensor of shape `(batch_size, 2)` or list of tuples (`Tuple[int, int]`) containing the target size
        (height, width) of each image in the batch. If left to None, predictions will not be resized.

Returns:
    `List[Dict[str, TensorType]]`: A list of dictionaries of tensors representing the processed depth
    predictions.
ÚtorchNz]Make sure that you pass in as many target sizes as the batch dimension of the predicted depthÚbicubicF)rT   ÚmodeÚalign_cornersÚpredicted_depth)r   r™   ÚlenrZ   Úzipr•   Únnr   ÚinterpolateÚ	unsqueezeÚsqueezeÚappend)r]   r�   r�   r™   ÚresultsÚdepthÚtarget_sizes   &&&    r   Úpost_process_depth_estimationÚ/DPTImageProcessor.post_process_depth_estimationø   sÛ   € ô( 	˜$ Ô(à!×1Ñ1ˆàÒ$¬3¨Ó+?Ä3À|ÓCTÔ+TÜØoóð ð ˆØ8DÒ8L˜�v¤ OÓ 4Ö4ÐR^ˆÜ"% oÖ"DÑˆEØÒ&ÜŸ™×+Ñ+×7Ñ7Ø—O‘O AÓ&×0Ñ0°Ó3¸+ÈIÐejð 8ó ç‘'“)ð ð �N‰NÐ-¨uÐ5Ö6ñ #Eð ˆr!   rE   gp?)Té   F)r¦   r$   )rF   rG   rH   rI   r   ÚBICUBICrU   r	   ry   r
   rz   rT   rs   rv   rx   r{   rw   r@   r   ru   rt   rB   r>   Úvalid_kwargsr\   ro   rŒ   r¤   rL   rM   rN   s   @r   rQ   rQ   e   s•   ø‡ € à!×)Ñ)€HØ'€JØ%€IØ�c˜7 CÐ(€DØ€IØ€JØ€LØ€FØ€NØÐØÐð €IØ€NØÐà*€L÷&kò &k÷P'ò '÷88 ð 8 ÷t'÷ 'ð 'r!   rQ   )#r&   Úcollections.abcr   Útypingr   r•   Úimage_processing_backendsr   Úimage_processing_baser   Úimage_transformsr   r   Úimage_utilsr	   r
   r   r   Úprocessing_utilsr   Úutilsr   r   r   Úbeit.image_processing_beitr   Úmodeling_outputsr   Útorchvision.transforms.v2r   rh   r<   r>   rQ   Ú__all__rE   r!   r   Ú<module>rµ      s}   ðó  Ý $Ý  ã å ;Ý 1ß E÷ó õ -ß BÑ BÝ ;÷ Ý8å 7õ$8ôN˜l°%õ ð( ôyÐ*ó yó ðyðx Ð
‚r!   