+
    œ°³jì  ã                   óà   € R 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 ]P"                  ! ]4      t ! R R]
R	R
7      t ! R R]R	R
7      t] ! R R]	4      4       tR.tR# )z
Processor class for UDOP.
)Úlogging)ÚBatchFeature)Ú
ImageInput)ÚProcessingKwargsÚProcessorMixinÚ
TextKwargsÚUnpack)ÚPreTokenizedInputÚ	TextInput)Úauto_docstringc                   ó,   a € ] tR t^t o V 3R ltRtV tR# )ÚUdopTextKwargsc                óî   <€ V ^8„  d   Qh/ S[ S[,          S[ S[ S[,          ,          ,          R,          ;R&   S[ S[ S[,          ,          S[ S[ S[ S[,          ,          ,          ,          R,          ;R&   # )é   NÚword_labelsÚboxes)ÚlistÚint)ÚformatÚ__classdict__s   "€Úi/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/udop/processing_udop.pyÚ__annotate__ÚUdopTextKwargs.__annotate__   sP   ø‡ ‚ Ù‘c•™T¡$¡s¥)�_Õ,¨tÕ3Ñ3ñ á‘‘S•	�?™T¡$¡t©C¥y¥/Õ2Õ2°TÕ9Ñ9ò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ ‡ „ r   r   F)Útotalc                   óX   a € ] tR t^#t o RRRRRRRR^ RRR	RR
RRRRR/	/tV 3R ltRtV tR# )ÚUdopProcessorKwargsÚtext_kwargsÚadd_special_tokensTÚpaddingFÚ
truncationÚstrideÚreturn_overflowing_tokensÚreturn_special_tokens_maskÚreturn_offsets_mappingÚreturn_lengthÚverbosec                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   r&   )r   )r   r   s   "€r   r   Ú UdopProcessorKwargs.__annotate__#   s   ø‡ ‚ ÙÑò r   r   N)r   r   r   r   Ú	_defaultsr   r    r!   r"   s   @r   r%   r%   #   sJ   ø‡ € ð 	Ø  $Ø�uØ˜%Ø�aØ'¨Ø(¨%Ø$ eØ˜UØ�tð

ð€I÷ ƒ r   r%   c                   ól   a a€ ] tR t^4t oRtV 3R lt]RV3R lR ll4       tR t]	R 4       t
RtVtV ;t# )	ÚUdopProcessoraK  
Constructs a UDOP processor which combines a LayoutLMv3 image processor and a UDOP tokenizer into a single processor.

[`UdopProcessor`] offers all the functionalities you need to prepare data for the model.

It first uses [`LayoutLMv3ImageProcessor`] to resize, rescale and normalize document images, and optionally applies OCR
to get words and normalized bounding boxes. These are then provided to [`UdopTokenizer`],
which turns the words and bounding boxes into token-level `input_ids`, `attention_mask`, `token_type_ids`, `bbox`.
Optionally, one can provide integer `word_labels`, which are turned into token-level `labels` for token
classification tasks (such as FUNSD, CORD).

Additionally, it also supports passing `text_target` and `text_pair_target` to the tokenizer, which can be used to
prepare labels for language modeling tasks.
c                ó&   <€ \         SV `  W4       R # )N)ÚsuperÚ__init__)ÚselfÚimage_processorÚ	tokenizerÚ	__class__s   &&&€r   r7   ÚUdopProcessor.__init__E   s   ø€ Ü‰Ñ˜Ö4r   c                ó    <€ V ^8„  d   QhRS[ R,          RS[S[,          S[S[,          ,          S[S[,          ,          RS[S[,          RS[/# )r   ÚimagesNÚtextÚkwargsÚreturn)r   r
   r	   r   r   r%   r   )r   r   s   "€r   r   ÚUdopProcessor.__annotate__I   s^   ø€ ÷ Fñ Fá˜TÕ!ðFñ Ñ+Õ+©d±9­oÕ=ÁÑEVÕ@WÕWðFñ Ñ,Õ-ð	Fñ
 
ñFr   c                ó   € V P                   ! \        3R V P                  P                  /VB pVR,          P	                  RR4      pVR,          P	                  RR4      pVR,          P	                  RR4      pVR,          P                  RR4      pVR,          P                  RR4      p	VR,          P                  R	R4      p
V P                  P                  '       d   Ve   \        R
4      hV P                  P                  '       d   Ve   \        R4      hV'       d   V	'       g   \        R4      hV
e   V P                  ! R/ VR,          B # V P                  ! RRV/VR,          B pVP	                  RR4      pVP	                  RR4      pVR,          P	                  R	R4       VR,          P	                  RR4       WtR,          R&   Ve   TMTVR,          R&   WdR,          R&   VeE   V P                  P                  '       d)   Vf%   \        V\        4      '       d   V.pWÄR,          R&   V P                  ! RRVe   TMT/VR,          B pVRJ d$   V P                  VR,          VR,          4      VR&   VP                  V4       V# )Útokenizer_init_kwargsr&   r   Nr   Ú	text_pairr+   Fr-   Útext_targetzdYou cannot provide bounding boxes if you initialized the image processor with apply_ocr set to True.zaYou cannot provide word labels if you initialized the image processor with apply_ocr set to True.zKYou cannot return overflowing tokens without returning the offsets mapping.r>   Úimages_kwargsÚwordsÚtext_pair_targetr?   TÚpixel_valuesÚoverflow_to_sample_mappingr   )Ú_merge_kwargsr%   r:   Úinit_kwargsÚpopÚgetr9   Ú	apply_ocrÚ
ValueErrorÚ
isinstanceÚstrÚget_overflowing_imagesÚupdate)r8   r>   r?   r@   Úoutput_kwargsr   r   rE   r+   r-   rF   ÚfeaturesÚfeatures_wordsÚfeatures_boxesÚencoded_inputss   &&&,           r   Ú__call__ÚUdopProcessor.__call__H   s“  € ð ×*Ò*Üñ
à"&§.¡.×"<Ñ"<ð
ð ñ
ˆð ˜mÕ,×0Ñ0°¸$Ó?ˆØ# MÕ2×6Ñ6°}ÀdÓKˆØ! -Õ0×4Ñ4°[À$ÓGˆ	Ø$1°-Õ$@×$DÑ$DÐE`ÐbgÓ$hÐ!Ø!.¨}Õ!=×!AÑ!AÐBZÐ\aÓ!bÐØ# MÕ2×6Ñ6°}ÀdÓKˆà×Ñ×)×)Ð)¨uÒ/@ÜØvóð ð ×Ñ×)×)Ð)¨{Ò/FÜØsóð ÷ %×-CÜÐjÓkÐkàÒ"à—>’>ñ Ø Õ.ñð ð ×+Ò+Ñ\°6Ð\¸]È?Õ=[Ñ\ˆHØ%Ÿ\™\¨'°4Ó8ˆNØ%Ÿ\™\¨'°4Ó8ˆNà˜-Õ(×,Ñ,¨]¸DÔAØ˜-Õ(×,Ñ,Ð-?ÀÔFØ8A˜-Õ(¨Ñ5Ø=BÒ=N±EÐTbˆM˜-Õ(¨Ñ1Ø:E˜-Õ(¨Ñ7ð Ò D×$8Ñ$8×$B×$BÐ$BÀyÒGXÜ˜d¤C×(Ò(Ø ˜6�DØ<J˜mÕ,¨[Ñ9à!Ÿ^š^ñ Ø!Ò-‘T°>ðà Õ.ñˆNð )¨DÓ0Ø+/×+FÑ+FØ˜^Õ,¨nÐ=YÕ.Zó,�˜Ñ(ð �O‰O˜NÔ+àˆOr   c                óÂ   € . pV F  pVP                  W,          4       K  	  \        V4      \        V4      8w  d$   \        R \        V4       R\        V4       24      hV# )z`Expected length of images to be the same as the length of `overflow_to_sample_mapping`, but got z and )ÚappendÚlenrQ   )r8   r>   rK   Úimages_with_overflowÚ
sample_idxs   &&&  r   rT   Ú$UdopProcessor.get_overflowing_images’   sr   € à!ÐÛ4ˆJØ ×'Ñ'¨Õ(:Ö;ñ 5ô Ð#Ó$¬Ð,FÓ(GÔGÜðÜÐ,Ó-Ð.¨e´CÐ8RÓ4SÐ3TðVóð ð
 $Ð#r   c                óŒ   € V P                   P                  pV P                  P                  p\        W,           R .,           4      # )Úbbox)r:   Úmodel_input_namesr9   r   )r8   Útokenizer_input_namesÚimage_processor_input_namess   &  r   re   ÚUdopProcessor.model_input_names    s:   € à $§¡× @Ñ @ÐØ&*×&:Ñ&:×&LÑ&LÐ#äÐ)ÕGÈ6È(ÕRÓSÐSr   r   )NN)r   r   r   r   Ú__doc__r7   r   r[   rT   Úpropertyre   r    r!   Ú__classcell__)r;   r   s   @@r   r4   r4   4   sM   ù‡ € ñõ5ð ÷Fñ Fó ðFòR$ð ñTó ÷Tð Tr   r4   N)ri   Útransformersr   Úimage_processing_utilsr   Úimage_utilsr   Úprocessing_utilsr   r   r   r   Útokenization_utils_baser	   r
   Úutilsr   Ú
get_loggerr   Úloggerr   r%   r4   Ú__all__r   r   r   Ú<module>ru      s|   ðñõ !å 2Ý %ß TÓ Tß CÝ #ð 
×	Ò	˜HÓ	%€ô:�Z uõ :ô
Ð*°%õ ð" ôpT�Nó pTó ðpTðf Ð
‚r   