+
    œ°³j•  ã                   ó¤   € R t ^ RI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Ht ^RIHtHt ^RIHtHt ] ! R	 R
]4      4       tR
.tR# )z$Image processor class for Perceiver.N)Ú
functional)ÚTorchvisionBackend)ÚBatchFeature)Úgroup_images_by_shapeÚreorder_images)ÚIMAGENET_DEFAULT_MEANÚIMAGENET_DEFAULT_STDÚPILImageResamplingÚSizeDict)ÚImagesKwargsÚUnpack)Ú
TensorTypeÚauto_docstringc                   ó´   a a€ ] tR t^ t oRt]P                  t]t	]
tR^àR^à/tRRRR/tRtRtRtRtV3R lV 3R lltV3R lV 3R	 lltV3R
 lR ltRtVtV ;t# )ÚPerceiverImageProcessorz:Torchvision backend for Perceiver with custom center crop.ÚheightÚwidthé   Tc                ó0   <€ V ^8„  d   QhRS[ S[,          /# )é   Úkwargs)r   r   )ÚformatÚ__classdict__s   "€Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/perceiver/image_processing_perceiver.pyÚ__annotate__Ú$PerceiverImageProcessor.__annotate__.   s   ø€ ÷ #ñ #¡©Õ!5ñ #ó    c                ó(   <€ \         SV `  ! R/ VB  R # )N© )ÚsuperÚ__init__)Úselfr   Ú	__class__s   &,€r   r    Ú PerceiverImageProcessor.__init__.   s   ø€ Ü‰ÒÑ"˜6Ô"r   c                ó.   <€ V ^8„  d   QhRRRS[ RS[ RR/# )r   Úimageútorch.TensorÚsizeÚ	crop_sizeÚreturn)r
   )r   r   s   "€r   r   r   1   s3   ø€ ÷ 
ñ 
àð
ñ ð
ñ ð	
ð 
ñ
r   c                ó  <€ VP                   e   VP                  f   \        RVP                  4        24      hVP                   e   VP                  f   \        RVP                  4        24      hVP                  RR w  rV\        WV4      p\        VP                   VP                   ,          V,          4      p\        VP                  VP                  ,          V,          4      p	\        S
V `   ! V\        W‰R7      3/ VB # )a,  
Center crop an image to ((size.height / crop_size.height) * min_dim, (size.width / crop_size.width) * min_dim),
where min_dim is the minimum of the image height and width.
If the requested crop size exceeds the image dimensions along any edge, the image is padded with zeros before
center cropping.
Nz=The size dictionary must have keys 'height' and 'width'. Got zBThe crop_size dictionary must have keys 'height' and 'width'. Got )r   r   éþÿÿÿ)
r   r   Ú
ValueErrorÚkeysÚshapeÚminÚintr   Úcenter_cropr
   )r!   r%   r'   r(   r   r   r   Úmin_dimÚcropped_heightÚcropped_widthr"   s   &&&&,     €r   r1   Ú#PerceiverImageProcessor.center_crop1   sæ   ø€ ð �;‰;Ò $§*¡*Ò"4ÜÐ\Ð]a×]fÑ]fÓ]hÐ\iÐjÓkÐkØ×ÑÒ# y§¡Ò'>ÜÐaÐbk×bpÑbpÓbrÐasÐtÓuÐuØŸ™ B CÐ(‰ˆÜ�fÓ$ˆÜ˜dŸk™k¨I×,<Ñ,<Õ<ÀÕGÓHˆÜ˜TŸZ™Z¨)¯/©/Õ9¸WÕDÓEˆÜ‰wÒ"ØÜ˜NÔ@ñ
ð ñ
ð 	
r   c                 ó*  <€ 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   Úimagesr&   Ú	do_resizer'   Úresamplez7PILImageResampling | tvF.InterpolationMode | int | NoneÚdo_center_cropr(   Ú
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanNÚ	image_stdÚdo_padÚpad_sizeÚdisable_groupingÚreturn_tensorsr)   )ÚlistÚboolr
   ÚfloatÚstrr   r   )r   r   s   "€r   r   r   L   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r   c           	     ó   € \        WR7      w  pp/ pVP                  4        F&  w  ppV'       d   V P                  VW6R7      pVVV&   K(  	  \        VV4      p\        VVR7      w  pp/ pVP                  4        F&  w  ppV'       d   V P	                  VW4R7      pVVV&   K(  	  \        VV4      p\        VVR7      w  pp/ pVP                  4        F  w  ppV P                  VWxWšV4      pVVV&   K!  	  \        VV4      p\        RV/VR7      # )zSCustom preprocessing for Perceiver: center_crop -> resize -> rescale and normalize.)rB   )r'   r(   )r%   r'   r9   Úpixel_values)ÚdataÚtensor_type)r   Úitemsr1   r   ÚresizeÚrescale_and_normalizer   )r!   r7   r8   r'   r9   r:   r(   r;   r<   r=   r>   r?   r@   rA   rB   rC   r   Úgrouped_imagesÚgrouped_images_indexÚcropped_images_groupedr.   Ústacked_imagesÚcropped_imagesÚresized_images_groupedÚresized_imagesÚprocessed_images_groupedÚprocessed_imagess   &&&&&&&&&&&&&&&&,          r   Ú_preprocessÚ#PerceiverImageProcessor._preprocessL   sD  € ô( 0EÀVÔ/oÑ,ˆÐ,Ø!#ÐØ%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%×!1Ñ!1°.ÀtÐ!1Ó!a�Ø,:Ð" 5Ó)ñ &<ô (Ð(>Ð@TÓUˆä/DÀ^ÐfvÔ/wÑ,ˆÐ,Ø!#ÐØ%3×%9Ñ%9Ö%;Ñ!ˆE�>ßØ!%§¡°>È Ó!`�Ø,:Ð" 5Ó)ñ &<ô (Ð(>Ð@TÓUˆä/DÀ^ÐfvÔ/wÑ,ˆÐ,Ø#%Ð Ø%3×%9Ñ%9Ö%;Ñ!ˆE�>Ø!×7Ñ7Ø 
¸LÐV_óˆNð /=Ð$ UÓ+ñ	 &<ô
 *Ð*BÐDXÓYÐä .Ð2BÐ!CÐQ_Ô`Ð`r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   ÚBICUBICr9   r   r>   r   r?   r'   r(   r8   r:   r;   r=   r    r1   rX   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r"   r   s   @@r   r   r       ss   ù‡ € áDà!×)Ñ)€HØ&€JØ$€IØ�c˜7 CÐ(€DØ˜3 ¨Ð-€IØ€IØ€NØ€JØ€L÷#ó #÷
ó 
÷6-a÷ -að -ar   r   )r^   ÚtorchÚtorchvision.transforms.v2r   ÚtvFÚimage_processing_backendsr   Úimage_processing_utilsr   Úimage_transformsr   r   Úimage_utilsr   r   r	   r
   Úprocessing_utilsr   r   Úutilsr   r   r   Ú__all__r   r   r   Ú<module>rm      sX   ðñ +ã Ý 7å ;Ý 2ß E÷ó ÷ 5ß /ð ôXaÐ0ó Xaó ðXaðv %Ð
%‚r   