+
    œ°³ja  ã                   ó  € R t ^ RIHt ^RIHt ^RIHt ^RIHtH	t	 ^RI
HtHtHt ^RIHtHt ^RIHtHtHtHt ]'       d   ^RIHt ^ R	It^ R
IHt ]P8                  ! ]4      t ! R R]RR7      t] ! R R]4      4       t R.t!R	# )zImage processor class for GLPN.)ÚTYPE_CHECKING)ÚTorchvisionBackend)ÚBatchFeature)Úgroup_images_by_shapeÚreorder_images)Ú
ImageInputÚPILImageResamplingÚSizeDict)ÚImagesKwargsÚUnpack)Ú
TensorTypeÚauto_docstringÚloggingÚrequires_backends)ÚDepthEstimatorOutputN)Ú
functionalc                   ó0   a € ] tR t^(t o RtV 3R ltRtV tR# )ÚGLPNImageProcessorKwargszÀ
size_divisor (`int`, *optional*, defaults to 32):
    When `do_resize` is `True`, images are resized so their height and width are rounded down to the closest
    multiple of `size_divisor`.
c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )é   Úsize_divisor)Úint)ÚformatÚ__classdict__s   "€Úo/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/glpn/image_processing_glpn.pyÚ__annotate__Ú%GLPNImageProcessorKwargs.__annotate__(   s   ø‡ ‚ ñ Ñò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r   (   s   ø‡ € ñ÷ ƒ r   r   F)Útotalc                   óä   a a€ ] tR t^2t oRt]tRtRtRt	]
P                  t^ tV3R lV 3R lltV 3R lt]V3R lV 3R ll4       tRV3R lV 3R	 llltRV3R
 lR lltRV3R lR lltRtVtV ;t# )ÚGLPNImageProcessorz6Torchvision backend for GLPN with size_divisor resize.Tc                ó0   <€ V ^8„  d   QhRS[ S[,          /# )r   Úkwargs)r   r   )r   r   s   "€r   r   ÚGLPNImageProcessor.__annotate__>   s   ø€ ÷ #ñ #¡Ñ(@Õ!Añ #r   c                ó(   <€ \         SV `  ! R/ VB  R # )Nr   )ÚsuperÚ__init__©Úselfr+   Ú	__class__s   &,€r   r/   ÚGLPNImageProcessor.__init__>   s   ø€ Ü‰ÒÑ"˜6Ô"r   c                óH   <€ VP                  R R4       \        SV `  ! R/ VB # )Ú	do_resizeNr   )Úpopr.   Ú_validate_preprocess_kwargsr0   s   &,€r   r7   Ú.GLPNImageProcessor._validate_preprocess_kwargsA   s$   ø€ à�
‰
�; Ô%Ü‰wÒ2Ñ<°VÑ<Ð<r   c                ó<   <€ V ^8„  d   QhRS[ RS[S[,          RS[/# )r   Úimagesr+   Úreturn)r   r   r   r   )r   r   s   "€r   r   r,   G   s)   ø€ ÷ 4ñ 4¡ð 4±vÑ>VÕ7Wð 4Ñ\hñ 4r   c                ó&   <€ \         SV `  ! V3/ VB # ©N)r.   Ú
preprocess)r1   r:   r+   r2   s   &&,€r   r>   ÚGLPNImageProcessor.preprocessF   s   ø€ ä‰wÒ! &Ñ3¨FÑ3Ð3r   c          
      ó2   <€ V ^8„  d   QhRRRS[ RRRS[RR/# )r   Úimageútorch.TensorÚsizeÚresampleú7PILImageResampling | tvF.InterpolationMode | int | Noner   r;   )r	   r   )r   r   s   "€r   r   r,   J   s>   ø€ ÷ 
ñ 
àð
ñ ð
ð Lð	
ñ
 ð
ð 
ñ
r   c                óž   <€ VP                   RR w  rgWd,          V,          pWt,          V,          p	\        S
V `  ! V\        W‰R7      3RV/VB # )zTResize so height and width are rounded down to the closest multiple of size_divisor.N)ÚheightÚwidthrD   éþÿÿÿ)Úshaper.   Úresizer	   )r1   rA   rC   rD   r   r+   rG   rH   Únew_hÚnew_wr2   s   &&&&&,    €r   rK   ÚGLPNImageProcessor.resizeJ   sa   ø€ ð Ÿ™ B CÐ(‰ˆØÕ&¨Õ5ˆØÕ%¨Õ4ˆÜ‰wŠ~ØÜ˜EÔ/ñ
ð ð
ð ñ	
ð 	
r   c          "      ó0  <€ V ^8„  d   QhRS[ R,          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,          RS[R,          RS[R,          RS[S[,          R,          RS[RS[/# )r   r:   rB   r5   rC   rD   rE   Údo_center_cropÚ	crop_sizeÚ
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanNÚ	image_stdÚdo_padÚpad_sizeÚdisable_groupingÚreturn_tensorsr   r;   )ÚlistÚboolr	   ÚfloatÚstrr   r   r   )r   r   s   "€r   r   r,   ]   s   ø€ ÷ añ aá�^Õ$ðañ ðañ ð	að
 Lðañ ðañ ðañ ðañ ðañ ðañ ™D¡�KÕ'¨$Õ.ðañ ™4¡�;Õ&¨Õ-ðañ �t•ðañ ˜T•/ðañ  �+ðañ  ™jÕ(¨4Õ/ð!añ" ð#añ& 
ñ'ar   c           	     óø   € \        WR7      w  pp/ pVP                  4        F;  w  ppV'       d   V P                  VW4VR7      pV P                  VWxWšV4      pVVV&   K=  	  \	        VV4      p\        RV/VR7      # )zCustom preprocessing for GLPN.)rY   )r   Úpixel_values)ÚdataÚtensor_type)r   ÚitemsrK   Úrescale_and_normalizer   r   )r1   r:   r5   rC   rD   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r   r+   Úgrouped_imagesÚgrouped_images_indexÚprocessed_images_groupedrJ   Ústacked_imagesÚprocessed_imagess   &&&&&&&&&&&&&&&&&,      r   Ú_preprocessÚGLPNImageProcessor._preprocess]   s—   € ô* 0EÀVÔ/oÑ,ˆÐ,Ø#%Ð Ø%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%§¡¨^¸TÐZf Ó!g�Ø!×7Ñ7Ø 
¸LÐV_óˆNð /=Ð$ UÓ+ñ &<ô *Ð*BÐDXÓYÐÜ .Ð2BÐ!CÐQ_Ô`Ð`r   c          	      ó”   <€ V ^8„  d   QhRRRS[ S[S[S[S[3,          ,          ,          R,          RS[S[S[S[ 3,          ,          /# )r   Úoutputsr   Útarget_sizesNr;   )r   r[   Útupler   Údictr^   )r   r   s   "€r   r   r,   ~   sN   ø€ ÷ ñ à'ðñ !¡4©©c±3¨h­Õ#8Õ8¸4Õ?ðñ 
‰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       Fq  w  rVVeV   VR,          p\
        P                  P                  P                  WVRRR7      pVP                  ^ 4      P                  ^ 4      pVP                  RV/4       Ks  	  V# )	zN
Convert raw model outputs to final depth predictions.
Only supports PyTorch.
ÚtorchNz]Make sure that you pass in as many target sizes as the batch dimension of the predicted depthÚbicubicF)rC   ÚmodeÚalign_cornersÚpredicted_depth)NN.)r   rv   ÚlenÚ
ValueErrorÚziprr   Únnr   ÚinterpolateÚsqueezeÚappend)r1   rm   rn   rv   ÚresultsÚdepthÚtarget_sizes   &&&    r   Úpost_process_depth_estimationÚ0GLPNImageProcessor.post_process_depth_estimation~   sØ   € ô 	˜$ Ô(Ø!×1Ñ1ˆØÒ#¬¨OÓ(<ÄÀLÓ@QÔ(QÜØoóð ð ˆØ8DÒ8L˜�v¤ OÓ 4Ö4ÐR^ˆÜ"% oÖ"DÑˆEØÒ&Ø˜oÕ.�ÜŸ™×+Ñ+×7Ñ7¸ÐV_ÐotÐ7Óu�ØŸ™ aÓ(×0Ñ0°Ó3�Ø�N‰NÐ-¨uÐ5Ö6ñ #Eð ˆr   r   gp?)é    r=   )r   r    r!   r"   r#   r   Úvalid_kwargsr5   rR   rS   r   ÚBILINEARrD   r   r/   r7   r   r>   rK   rj   r�   r%   r&   Ú__classcell__)r2   r   s   @@r   r)   r)   2   sz   ù‡ € á@à+€Là€IØ€JØ€NØ!×*Ñ*€HØ€L÷#ó #õ=ð
 ÷4ò 4ó ð4÷
õ 
÷&aò a÷B÷ ò r   r)   )"r#   Útypingr   Úimage_processing_backendsr   Úimage_processing_utilsr   Úimage_transformsr   r   Úimage_utilsr   r   r	   Úprocessing_utilsr
   r   Úutilsr   r   r   r   Úmodeling_outputsr   rr   Útorchvision.transforms.v2r   ÚtvFÚ
get_loggerr   Úloggerr   r)   Ú__all__r   r   r   Ú<module>r”      sƒ   ðñ &å  å ;Ý 2ß E÷ñ ÷
 5ß KÓ K÷ Ý8ã Ý 7ð 
×	Ò	˜HÓ	%€ô˜|°5õ ð ôbÐ+ó bó ðbðJ  Ð
 ‚r   