Ë
    îÍ:jþ“  ã                   ól  — d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 d dlZd dlZddlmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZmZmZm Z   e«       r´d dl!Z"d dl#Z"e"jH                  jJ                  Z& e«       r�d d	l'm(Z( e&jR                  e(jT                  e&jV                  e(jV                  e&jX                  e(jX                  e&jZ                  e(jZ                  e&j\                  e(j\                  e&j^                  e(j^                  iZ0ni Z0 e«       rd dl1Z1 ejd                  e3«      Z4e
d
ejj                  de6d
   e6ejj                     e6d   f   Z7 G d„ de«      Z8 G d„ de«      Z9 G d„ de«      Z:e;e<e
e=e<e6e;   f   f   Z>d„ Z? G d„ de«      Z@d„ ZAd„ ZBde6fd„ZCd„ ZDd„ ZEd„ ZFdejj                  deGfd„ZHdTde=de6e7   fd „ZI	 dTde
e6e7   e7f   de=de7fd!„ZJ	 dTde
e6e7   e7f   de=de6e7   fd"„ZKdejj                  fd#„ZL	 dUdejj                  d$e	e
e=eMe=d%f   f      de8fd&„ZN	 dUdejj                  d'e	e
e8e<f      de=fd(„ZOdUdejj                  d)e	e8   deMe=e=f   fd*„ZPd+eMe=e=f   d,e=d-e=deMe=e=f   fd.„ZQd/e;e<e
e6eMf   f   deGfd0„ZRd/e;e<e
e6eMf   f   deGfd1„ZSd2ee;e<e
e6eMf   f      deGfd3„ZTd2ee;e<e
e6eMf   f      deGfd4„ZUdUde
e<d
f   d5e	eV   dd
fd6„ZW	 dUde
e6eMe<d
f   d5e	eV   de
d
e6d
   e6e6d
      f   fd7„ZX	 	 	 	 	 	 	 	 	 	 	 	 	 dVd8e	eG   d9e	eV   d:e	eG   d;e	e
eVe6eV   f      d<e	e
eVe6eV   f      d=e	eG   d>e	e
e;e<e=f   e=f      d?e	eG   d@e	e;e<e=f      dAe	eG   dBe	e;e<e=f      dCe	dD   dEe	dF   fdG„ZY G dH„ dI«      ZZdJe9dKeMe9d%f   d2e6e;   ddfdL„Z[dMe6e<   dNe6e<   fdO„Z\ edP¬Q«       G dR„ dS«      «       Z]y)Wé    N)ÚIterable)Ú	dataclass)ÚBytesIO)ÚOptionalÚUnioné   )ÚExplicitEnumÚis_jax_tensorÚis_numpy_arrayÚis_tf_tensorÚis_torch_availableÚis_torch_tensorÚis_torchvision_availableÚis_vision_availableÚloggingÚrequires_backendsÚto_numpy)ÚIMAGENET_DEFAULT_MEANÚIMAGENET_DEFAULT_STDÚIMAGENET_STANDARD_MEANÚIMAGENET_STANDARD_STDÚOPENAI_CLIP_MEANÚOPENAI_CLIP_STD)ÚInterpolationModezPIL.Image.Imageztorch.Tensorc                   ó   — e Zd ZdZdZy)ÚChannelDimensionÚchannels_firstÚchannels_lastN)Ú__name__Ú
__module__Ú__qualname__ÚFIRSTÚLAST© ó    úm/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/transformers/image_utils.pyr   r   Q   s   „ Ø€EØ�Dr%   r   c                   ó   — e Zd ZdZdZy)ÚAnnotationFormatÚcoco_detectionÚcoco_panopticN)r   r    r!   ÚCOCO_DETECTIONÚCOCO_PANOPTICr$   r%   r&   r(   r(   V   s   „ Ø%€NØ#�Mr%   r(   c                   ód   — e Zd Zej                  j
                  Zej                  j
                  Zy)ÚAnnotionFormatN)r   r    r!   r(   r+   Úvaluer,   r$   r%   r&   r.   r.   [   s$   „ Ø%×4Ñ4×:Ñ:€NØ$×2Ñ2×8Ñ8�Mr%   r.   c                 ób   — t        «       xr$ t        | t        j                  j                  «      S ©N)r   Ú
isinstanceÚPILÚImage©Úimgs    r&   Úis_pil_imager7   c   s   € ÜÓ ÒE¤Z°´S·Y±Y·_±_Ó%EÐEr%   c                   ó    — e Zd ZdZdZdZdZdZy)Ú	ImageTypeÚpillowÚtorchÚnumpyÚ
tensorflowÚjaxN)r   r    r!   r3   ÚTORCHÚNUMPYÚ
TENSORFLOWÚJAXr$   r%   r&   r9   r9   g   s   „ Ø
€CØ€EØ€EØ€JØ
�Cr%   r9   c                 ó>  — t        | «      rt        j                  S t        | «      rt        j                  S t        | «      rt        j                  S t        | «      rt        j                  S t        | «      rt        j                  S t        dt        | «      › �«      ‚)NzUnrecognized image type )r7   r9   r3   r   r?   r   r@   r   rA   r
   rB   Ú
ValueErrorÚtype©Úimages    r&   Úget_image_typerH   o   su   € Ü�EÔÜ�}‰}ÐÜ�uÔÜ�‰ÐÜ�eÔÜ�‰ÐÜ�EÔÜ×#Ñ#Ð#Ü�UÔÜ�}‰}ÐÜ
Ð/´°U³¨}Ð=Ó
>Ð>r%   c                 ó€   — t        | «      xs2 t        | «      xs% t        | «      xs t        | «      xs t	        | «      S r1   )r7   r   r   r   r
   r5   s    r&   Úis_valid_imagerJ   }   s8   € Ü˜ÓÒv¤¨sÓ 3Òv´ÀsÓ7KÒvÌ|Ð\_ÓO`ÒvÔdqÐruÓdvÐvr%   Úimagesc                 ó.   — | xr t        d„ | D «       «      S )Nc              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr1   )rJ   )Ú.0rG   s     r&   ú	<genexpr>z*is_valid_list_of_images.<locals>.<genexpr>‚   s   è ø€ ÒD°Eœ.¨×/ÑDùó   ‚©Úall)rK   s    r&   Úis_valid_list_of_imagesrS   �   s   € ØÒD”cÑD¸VÔDÓDÐDr%   c                 ó8  — t        | d   t        «      r| D ��cg c]  }|D ]  }|‘Œ Œ c}}S t        | d   t        j                  «      rt        j                  | d¬«      S t        | d   t
        j                  «      rt        j                  | d¬«      S y c c}}w )Nr   ©Úaxis)Údim)r2   ÚlistÚnpÚndarrayÚconcatenater;   ÚTensorÚcat)Ú
input_listÚsublistÚitems      r&   Úconcatenate_listra   …   s~   € Ü�*˜Q‘-¤Ô&Ø$.×C˜¸7ÒC°4’ÐC�ÓCÐCÜ	�J˜q‘M¤2§:¡:Ô	.Ü�~‰~˜j¨qÔ1Ð1Ü	�J˜q‘M¤5§<¡<Ô	0Ü�y‰y˜¨Ô+Ð+ð 
1ùó Ds   ™Bc                 ór   — t        | t        t        f«      r| D ]  }t        |«      rŒ y yt	        | «      syy)NFT)r2   rX   ÚtupleÚvalid_imagesrJ   )Úimgsr6   s     r&   rd   rd   Ž   s?   € ä�$œœu˜Ô&Øò 	ˆCÜ Õ$Ùð	ð ô ˜DÔ!ØØr%   c                 óL   — t        | t        t        f«      rt        | d   «      S y)Nr   F)r2   rX   rc   rJ   r5   s    r&   Ú
is_batchedrg   š   s"   € Ü�#œœe�}Ô%Ü˜c !™fÓ%Ð%Ør%   rG   Úreturnc                 ó¢   — | j                   t        j                  k(  ryt        j                  | «      dk\  xr t        j                  | «      dk  S )zV
    Checks to see whether the pixel values have already been rescaled to [0, 1].
    Fr   r   )ÚdtyperY   Úuint8ÚminÚmaxrF   s    r&   Úis_scaled_imagern       s>   € ð ‡{�{”b—h‘hÒØô �6‰6�%‹=˜AÑÒ4¤"§&¡&¨£-°1Ñ"4Ð4r%   Úexpected_ndimsc           	      ó(  — t        | «      r| S t        | «      r| gS t        | «      rU| j                  |dz   k(  rt	        | «      } | S | j                  |k(  r| g} | S t        d|dz   › d|› d| j                  › d�«      ‚t        dt        | «      › d�«      ‚)a  
    Ensure that the output is a list of images. If the input is a single image, it is converted to a list of length 1.
    If the input is a batch of images, it is converted to a list of images.

    Args:
        images (`ImageInput`):
            Image of images to turn into a list of images.
        expected_ndims (`int`, *optional*, defaults to 3):
            Expected number of dimensions for a single input image. If the input image has a different number of
            dimensions, an error is raised.
    r   z%Invalid image shape. Expected either z or z dimensions, but got z dimensions.ztInvalid image type. Expected either PIL.Image.Image, numpy.ndarray, torch.Tensor, tf.Tensor or jax.ndarray, but got ú.)rg   r7   rJ   ÚndimrX   rD   rE   )rK   ro   s     r&   Úmake_list_of_imagesrs   «   sÅ   € ô �&ÔØˆô �FÔàˆxˆä�fÔØ�;‰;˜.¨1Ñ,Ò,ä˜&“\ˆFð ˆð �[‰[˜NÒ*à�XˆFð ˆô	 Ø7¸ÈÑ8JÐ7KÈ4ÐP^ÐO_ð `Ø—K‘K�= ð.óð ô
 ð	 Ü $ V£˜~¨Qð	0óð r%   c                 óH  — t        | t        t        f«      r=t        d„ | D «       «      r+t        d„ | D «       «      r| D ��cg c]  }|D ]  }|‘Œ Œ c}}S t        | t        t        f«      r[t	        | «      rPt        | d   «      s| d   j                  |k(  r| S | d   j                  |dz   k(  r| D ��cg c]  }|D ]  }|‘Œ Œ c}}S t        | «      r:t        | «      s| j                  |k(  r| gS | j                  |dz   k(  rt        | «      S t        d| › �«      ‚c c}}w c c}}w )aÿ  
    Ensure that the output is a flat list of images. If the input is a single image, it is converted to a list of length 1.
    If the input is a nested list of images, it is converted to a flat list of images.
    Args:
        images (`Union[list[ImageInput], ImageInput]`):
            The input image.
        expected_ndims (`int`, *optional*, defaults to 3):
            The expected number of dimensions for a single input image.
    Returns:
        list: A list of images or a 4d array of images.
    c              3   óH   K  — | ]  }t        |t        t        f«      –— Œ y ­wr1   ©r2   rX   rc   ©rN   Úimages_is     r&   rO   z+make_flat_list_of_images.<locals>.<genexpr>ä   ó   è ø€ ÒK¸”
˜8¤d¬E ]×3ÑKùó   ‚ "c              3   ó<   K  — | ]  }t        |«      xs | –— Œ y ­wr1   ©rS   rw   s     r&   rO   z+make_flat_list_of_images.<locals>.<genexpr>å   ó    è ø€ ÒYÀhÔ'¨Ó1ÒA¸°\ÓAÑYùó   ‚r   r   z*Could not make a flat list of images from ©	r2   rX   rc   rR   rS   r7   rr   rJ   rD   )rK   ro   Úimg_listr6   s       r&   Úmake_flat_list_of_imagesr�   Ò   s  € ô" 	�6œD¤%˜=Ô)ÜÑKÀFÔKÔKÜÑYÐRXÔYÔYà$*×?˜°hÒ?¨s’Ð?�Ó?Ð?ä�&œ4¤˜-Ô(Ô-DÀVÔ-LÜ˜˜q™	Ô" f¨Q¡i§n¡n¸Ò&FØˆMØ�!‰9�>‰>˜^¨aÑ/Ò/Ø(.×C˜H¸(ÒC°3’CÐC�CÓCÐCä�fÔÜ˜Ô 6§;¡;°.Ò#@Ø�8ˆOØ�;‰;˜.¨1Ñ,Ò,Ü˜“<Ðä
ÐAÀ&ÀÐJÓ
KÐKùó @ùó Ds   Á DÂ1Dc                 ó  — t        | t        t        f«      r&t        d„ | D «       «      rt        d„ | D «       «      r| S t        | t        t        f«      r\t	        | «      rQt        | d   «      s| d   j                  |k(  r| gS | d   j                  |dz   k(  r| D �cg c]  }t        |«      ‘Œ c}S t        | «      r<t        | «      s| j                  |k(  r| ggS | j                  |dz   k(  rt        | «      gS t        d«      ‚c c}w )as  
    Ensure that the output is a nested list of images.
    Args:
        images (`Union[list[ImageInput], ImageInput]`):
            The input image.
        expected_ndims (`int`, *optional*, defaults to 3):
            The expected number of dimensions for a single input image.
    Returns:
        list: A list of list of images or a list of 4d array of images.
    c              3   óH   K  — | ]  }t        |t        t        f«      –— Œ y ­wr1   rv   rw   s     r&   rO   z-make_nested_list_of_images.<locals>.<genexpr>	  ry   rz   c              3   ó<   K  — | ]  }t        |«      xs | –— Œ y ­wr1   r|   rw   s     r&   rO   z-make_nested_list_of_images.<locals>.<genexpr>
  r}   r~   r   r   z]Invalid input type. Must be a single image, a list of images, or a list of batches of images.r   )rK   ro   rG   s      r&   Úmake_nested_list_of_imagesr…   ø   sí   € ô  	�6œD¤%˜=Ô)ÜÑKÀFÔKÔKÜÑYÐRXÔYÔYàˆô �&œ4¤˜-Ô(Ô-DÀVÔ-LÜ˜˜q™	Ô" f¨Q¡i§n¡n¸Ò&FØ�8ˆOØ�!‰9�>‰>˜^¨aÑ/Ò/Ø-3Ö4 E”D˜•KÒ4Ð4ô �fÔÜ˜Ô 6§;¡;°.Ò#@Ø�H�:ÐØ�;‰;˜.¨1Ñ,Ò,Ü˜“L�>Ð!ä
ÐtÓ
uÐuùò 5s   ÂDc                 óâ   — t        | «      st        dt        | «      › �«      ‚t        «       r9t	        | t
        j                  j                  «      rt        j                  | «      S t        | «      S )NzInvalid image type: )
rJ   rD   rE   r   r2   r3   r4   rY   Úarrayr   r5   s    r&   Úto_numpy_arrayrˆ     sP   € Ü˜#ÔÜÐ/´°S³	¨{Ð;Ó<Ð<äÔ¤¨C´·±·±Ô!AÜ�x‰x˜‹}ÐÜ�C‹=Ðr%   Únum_channels.c                 ó*  — |�|nd}t        |t        «      r|fn|}| j                  dk(  rd\  }}nB| j                  dk(  rd\  }}n-| j                  dk(  rd\  }}nt        d| j                  › �«      ‚| j                  |   |v rD| j                  |   |v r3t
        j                  d| j                  › d	�«       t        j                  S | j                  |   |v rt        j                  S | j                  |   |v rt        j                  S t        d
«      ‚)a[  
    Infers the channel dimension format of `image`.

    Args:
        image (`np.ndarray`):
            The image to infer the channel dimension of.
        num_channels (`int` or `tuple[int, ...]`, *optional*, defaults to `(1, 3)`):
            The number of channels of the image.

    Returns:
        The channel dimension of the image.
    ©r   é   rŒ   )r   é   é   é   )r�   rŽ   z(Unsupported number of image dimensions: z4The channel dimension is ambiguous. Got image shape zú. Assuming channels are the first dimension. Use the [input_data_format](https://huggingface.co/docs/transformers/main/internal/image_processing_utils#transformers.image_transforms.rescale.input_data_format) parameter to assign the channel dimension.z(Unable to infer channel dimension format)
r2   Úintrr   rD   ÚshapeÚloggerÚwarningr   r"   r#   )rG   r‰   Ú	first_dimÚlast_dims       r&   Úinfer_channel_dimension_formatr–   (  s  € ð $0Ð#;‘<À€LÜ&0°¼sÔ&C�L‘?È€Là‡z�z�Q‚Ø"Ñˆ	‘8Ø	�‰�qŠØ"Ñˆ	‘8Ø	�‰�qŠØ"Ñˆ	‘8äÐCÀEÇJÁJÀ<ÐPÓQÐQà‡{�{�9Ñ Ñ-°%·+±+¸hÑ2GÈ<Ñ2WÜ�‰ØBÀ5Ç;Á;À-ð  PJð  Kô	
ô  ×%Ñ%Ð%Ø	�‰�YÑ	 <Ñ	/Ü×%Ñ%Ð%Ø	�‰�XÑ	 ,Ñ	.Ü×$Ñ$Ð$Ü
Ð?Ó
@Ð@r%   Úinput_data_formatc                 óÀ   — |€t        | «      }|t        j                  k(  r| j                  dz
  S |t        j                  k(  r| j                  dz
  S t        d|› �«      ‚)a–  
    Returns the channel dimension axis of the image.

    Args:
        image (`np.ndarray`):
            The image to get the channel dimension axis of.
        input_data_format (`ChannelDimension` or `str`, *optional*):
            The channel dimension format of the image. If `None`, will infer the channel dimension from the image.

    Returns:
        The channel dimension axis of the image.
    rŒ   r   úUnsupported data format: )r–   r   r"   rr   r#   rD   )rG   r—   s     r&   Úget_channel_dimension_axisrš   O  sd   € ð Ð Ü:¸5ÓAÐØÔ,×2Ñ2Ò2Ø�z‰z˜A‰~ÐØ	Ô.×3Ñ3Ò	3Ø�z‰z˜A‰~ÐÜ
Ð0Ð1BÐ0CÐDÓ
EÐEr%   Úchannel_dimc                 óü   — |€t        | «      }|t        j                  k(  r| j                  d   | j                  d   fS |t        j                  k(  r| j                  d   | j                  d   fS t        d|› �«      ‚)a�  
    Returns the (height, width) dimensions of the image.

    Args:
        image (`np.ndarray`):
            The image to get the dimensions of.
        channel_dim (`ChannelDimension`, *optional*):
            Which dimension the channel dimension is in. If `None`, will infer the channel dimension from the image.

    Returns:
        A tuple of the image's height and width.
    éþÿÿÿéÿÿÿÿéýÿÿÿr™   )r–   r   r"   r‘   r#   rD   )rG   r›   s     r&   Úget_image_sizer    g  s{   € ð ÐÜ4°UÓ;ˆàÔ&×,Ñ,Ò,Ø�{‰{˜2‰ §¡¨B¡Ð/Ð/Ø	Ô(×-Ñ-Ò	-Ø�{‰{˜2‰ §¡¨B¡Ð/Ð/äÐ4°[°MÐBÓCÐCr%   Ú
image_sizeÚ
max_heightÚ	max_widthc                 óx   — | \  }}||z  }||z  }t        ||«      }t        ||z  «      }t        ||z  «      }	||	fS )aË  
    Computes the output image size given the input image and the maximum allowed height and width. Keep aspect ratio.
    Important, even if image_height < max_height and image_width < max_width, the image will be resized
    to at least one of the edges be equal to max_height or max_width.

    For example:
        - input_size: (100, 200), max_height: 50, max_width: 50 -> output_size: (25, 50)
        - input_size: (100, 200), max_height: 200, max_width: 500 -> output_size: (200, 400)

    Args:
        image_size (`tuple[int, int]`):
            The image to resize.
        max_height (`int`):
            The maximum allowed height.
        max_width (`int`):
            The maximum allowed width.
    )rl   r�   )
r¡   r¢   r£   ÚheightÚwidthÚheight_scaleÚwidth_scaleÚ	min_scaleÚ
new_heightÚ	new_widths
             r&   Ú#get_image_size_for_max_height_widthr¬     sV   € ð, �M€FˆEØ Ñ&€LØ˜eÑ#€KÜ�L +Ó.€IÜ�V˜iÑ'Ó(€JÜ�E˜IÑ%Ó&€IØ�yÐ Ð r%   Ú
annotationc                 ó¶   — t        | t        «      rId| v rEd| v rAt        | d   t        t        f«      r(t	        | d   «      dk(  st        | d   d   t        «      ryy)NÚimage_idÚannotationsr   TF©r2   ÚdictrX   rc   Úlen©r­   s    r&   Ú"is_valid_annotation_coco_detectionrµ   ž  s`   € ä�:œtÔ$Ø˜*Ñ$Ø˜ZÑ'Ü�z -Ñ0´4¼°-Ô@ô �
˜=Ñ)Ó*¨aÒ/´:¸jÈÑ>WÐXYÑ>ZÔ\`Ô3að Ør%   c                 ó¾   — t        | t        «      rMd| v rId| v rEd| v rAt        | d   t        t        f«      r(t	        | d   «      dk(  st        | d   d   t        «      ryy)Nr¯   Úsegments_infoÚ	file_namer   TFr±   r´   s    r&   Ú!is_valid_annotation_coco_panopticr¹   ­  sh   € ä�:œtÔ$Ø˜*Ñ$Ø˜zÑ)Ø˜:Ñ%Ü�z /Ñ2´T¼5°MÔBô �
˜?Ñ+Ó,°Ò1´ZÀ
È?Ñ@[Ð\]Ñ@^Ô`dÔ5eð Ør%   r°   c                 ó&   — t        d„ | D «       «      S )Nc              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr1   )rµ   ©rN   Úanns     r&   rO   z3valid_coco_detection_annotations.<locals>.<genexpr>¾  s   è ø€ ÒN¸3Ô1°#×6ÑNùrP   rQ   ©r°   s    r&   Ú valid_coco_detection_annotationsr¿   ½  s   € ÜÑNÀ+ÔNÓNÐNr%   c                 ó&   — t        d„ | D «       «      S )Nc              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr1   )r¹   r¼   s     r&   rO   z2valid_coco_panoptic_annotations.<locals>.<genexpr>Â  s   è ø€ ÒM¸#Ô0°×5ÑMùrP   rQ   r¾   s    r&   Úvalid_coco_panoptic_annotationsrÂ   Á  s   € ÜÑMÀÔMÓMÐMr%   Útimeoutc                 ó‚  — t        t        dg«       t        | t        «      �r| j	                  d«      s| j	                  d«      rHt
        j                  j                  t        t        j                  | |¬«      j                  «      «      } nàt        j                  j                  | «      r t
        j                  j                  | «      } n¡| j	                  d«      r| j                  d«      d   } 	 t!        j"                  | j%                  «       «      }t
        j                  j                  t        |«      «      } n/t        | t
        j                  j                  «      st+        d«      ‚t
        j,                  j/                  | «      } | j1                  d«      } | S # t&        $ r}t)        d| › d	|› �«      ‚d
}~ww xY w)a3  
    Loads `image` to a PIL Image.

    Args:
        image (`str` or `PIL.Image.Image`):
            The image to convert to the PIL Image format.
        timeout (`float`, *optional*):
            The timeout value in seconds for the URL request.

    Returns:
        `PIL.Image.Image`: A PIL Image.
    Úvisionzhttp://zhttps://©rÃ   zdata:image/ú,r   z’Incorrect image source. Must be a valid URL starting with `http://` or `https://`, a valid path to an image file, or a base64 encoded string. Got z. Failed with NzuIncorrect format used for image. Should be an url linking to an image, a base64 string, a local path, or a PIL image.ÚRGB)r   Ú
load_imager2   ÚstrÚ
startswithr3   r4   Úopenr   ÚrequestsÚgetÚcontentÚosÚpathÚisfileÚsplitÚbase64ÚdecodebytesÚencodeÚ	ExceptionrD   Ú	TypeErrorÚImageOpsÚexif_transposeÚconvert)rG   rÃ   Úb64Úes       r&   rÉ   rÉ   Å  sq  € ô ”j 8 *Ô-Ü�%œÕØ×Ñ˜IÔ&¨%×*:Ñ*:¸:Ô*Fô —I‘I—N‘N¤7¬8¯<©<¸ÀwÔ+O×+WÑ+WÓ#XÓY‰EÜ�W‰W�^‰^˜EÔ"Ü—I‘I—N‘N 5Ó)‰Eà×Ñ Ô.ØŸ™ CÓ(¨Ñ+�ðÜ×(Ñ(¨¯©«Ó8�ÜŸ	™	Ÿ™¤w¨s£|Ó4‘ô
 ˜œsŸy™yŸ™Ô/Üð Dó
ð 	
ô �L‰L×'Ñ'¨Ó.€EØ�M‰M˜%Ó €EØ€Løô ò Ü ð ið  joð  ipð  p~ð  @ð  ~Að  Bóð ûðús   Ã2AF Æ	F>Æ(F9Æ9F>c                 ó<  — t        | t        t        f«      rjt        | «      rDt        | d   t        t        f«      r+| D ��cg c]  }|D �cg c]  }t	        ||¬«      ‘Œ c}‘Œ c}}S | D �cg c]  }t	        ||¬«      ‘Œ c}S t	        | |¬«      S c c}w c c}}w c c}w )a  Loads images, handling different levels of nesting.

    Args:
      images: A single image, a list of images, or a list of lists of images to load.
      timeout: Timeout for loading images.

    Returns:
      A single image, a list of images, a list of lists of images.
    r   rÆ   )r2   rX   rc   r³   rÉ   )rK   rÃ   Úimage_grouprG   s       r&   Úload_imagesrà   ï  s   € ô �&œ4¤˜-Ô(ÜˆvŒ;œ: f¨Q¡i´$¼°Ô?Øek×lÐVaÀ[ÖQ¸E”Z ¨wÖ7ÔQÓlÐlàDJÖK¸5”J˜u¨gÖ6ÒKÐKä˜&¨'Ô2Ð2ùò	 RùÓlùâKs   Á 	BÁ	BÁBÁ*BÂBÚ
do_rescaleÚrescale_factorÚdo_normalizeÚ
image_meanÚ	image_stdÚdo_padÚpad_sizeÚdo_center_cropÚ	crop_sizeÚ	do_resizeÚsizeÚresampleÚPILImageResamplingÚinterpolationr   c                 óÈ   — | r|€t        d«      ‚|r|€t        d«      ‚|r|�|€t        d«      ‚|r|€t        d«      ‚|�|�t        d«      ‚|	r|
�|€|€t        d«      ‚yyy)a‡  
    Checks validity of typically used arguments in an `ImageProcessor` `preprocess` method.
    Raises `ValueError` if arguments incompatibility is caught.
    Many incompatibilities are model-specific. `do_pad` sometimes needs `size_divisor`,
    sometimes `size_divisibility`, and sometimes `size`. New models and processors added should follow
    existing arguments when possible.

    Nz=`rescale_factor` must be specified if `do_rescale` is `True`.zgDepending on the model, `size_divisor` or `pad_size` or `size` must be specified if `do_pad` is `True`.zP`image_mean` and `image_std` must both be specified if `do_normalize` is `True`.z<`crop_size` must be specified if `do_center_crop` is `True`.zbOnly one of `interpolation` and `resample` should be specified, depending on image processor type.zO`size` and `resample/interpolation` must be specified if `do_resize` is `True`.)rD   )rá   râ   rã   rä   rå   ræ   rç   rè   ré   rê   rë   rì   rî   s                r&   Úvalidate_preprocess_argumentsrð     s¨   € ñ. �nÐ,ÜÐXÓYÐYá�(Ð"ô Øuó
ð 	
ñ ˜Ð+¨yÐ/@ÜÐkÓlÐlá˜)Ð+ÜÐWÓXÐXàÐ  XÐ%9ÜØpó
ð 	
ñ ˜$Ð*°Ð0DÈÐHaÜÐjÓkÐkð IbÐ0D€yr%   c                   óœ   — e Zd ZdZd„ Zdd„Zd„ Zdej                  de	e
ef   dej                  fd	„Zdd
„Zd„ Zdd„Zdd„Zd„ Zd„ Zdd„Zy)ÚImageFeatureExtractionMixinzD
    Mixin that contain utilities for preparing image features.
    c                 ó´   — t        |t        j                  j                  t        j                  f«      s$t        |«      st        dt        |«      › d�«      ‚y y )Nz	Got type zU which is not supported, only `PIL.Image.Image`, `np.ndarray` and `torch.Tensor` are.)r2   r3   r4   rY   rZ   r   rD   rE   ©ÚselfrG   s     r&   Ú_ensure_format_supportedz4ImageFeatureExtractionMixin._ensure_format_supported>  sQ   € Ü˜%¤#§)¡)§/¡/´2·:±:Ð!>Ô?ÌÐX]ÔH^ÜØœD ›K˜=ð )&ð &óð ð I_Ð?r%   Nc                 óÔ  — | j                  |«       t        |«      r|j                  «       }t        |t        j
                  «      r¡|€'t        |j                  d   t        j                  «      }|j                  dk(  r$|j                  d   dv r|j                  ddd«      }|r|dz  }|j                  t        j                  «      }t        j                  j                  |«      S |S )a"  
        Converts `image` to a PIL Image. Optionally rescales it and puts the channel dimension back as the last axis if
        needed.

        Args:
            image (`PIL.Image.Image` or `numpy.ndarray` or `torch.Tensor`):
                The image to convert to the PIL Image format.
            rescale (`bool`, *optional*):
                Whether or not to apply the scaling factor (to make pixel values integers between 0 and 255). Will
                default to `True` if the image type is a floating type, `False` otherwise.
        r   rŒ   r‹   r   r�   éÿ   )rö   r   r<   r2   rY   rZ   ÚflatÚfloatingrr   r‘   Ú	transposeÚastyperk   r3   r4   Ú	fromarray)rõ   rG   Úrescales      r&   Úto_pil_imagez(ImageFeatureExtractionMixin.to_pil_imageE  s´   € ð 	×%Ñ% eÔ,ä˜5Ô!Ø—K‘K“MˆEä�eœRŸZ™ZÔ(Øˆä$ U§Z¡Z°¡]´B·K±KÓ@�à�z‰z˜QŠ 5§;¡;¨q¡>°VÑ#;ØŸ™¨¨1¨aÓ0�ÙØ ™�Ø—L‘L¤§¡Ó*ˆEÜ—9‘9×&Ñ& uÓ-Ð-Øˆr%   c                 ó’   — | j                  |«       t        |t        j                  j                  «      s|S |j	                  d«      S )z—
        Converts `PIL.Image.Image` to RGB format.

        Args:
            image (`PIL.Image.Image`):
                The image to convert.
        rÈ   )rö   r2   r3   r4   rÛ   rô   s     r&   Úconvert_rgbz'ImageFeatureExtractionMixin.convert_rgbc  s8   € ð 	×%Ñ% eÔ,Ü˜%¤§¡§¡Ô1ØˆLà�}‰}˜UÓ#Ð#r%   rG   Úscalerh   c                 ó.   — | j                  |«       ||z  S )z7
        Rescale a numpy image by scale amount
        )rö   )rõ   rG   r  s      r&   rþ   z#ImageFeatureExtractionMixin.rescaleq  s   € ð 	×%Ñ% eÔ,Ø�u‰}Ðr%   c                 óÐ  — | j                  |«       t        |t        j                  j                  «      rt	        j
                  |«      }t        |«      r|j                  «       }|€'t        |j                  d   t        j                  «      n|}|r/| j                  |j                  t        j                  «      d«      }|r"|j                  dk(  r|j                  ddd«      }|S )aÓ  
        Converts `image` to a numpy array. Optionally rescales it and puts the channel dimension as the first
        dimension.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image to convert to a NumPy array.
            rescale (`bool`, *optional*):
                Whether or not to apply the scaling factor (to make pixel values floats between 0. and 1.). Will
                default to `True` if the image is a PIL Image or an array/tensor of integers, `False` otherwise.
            channel_first (`bool`, *optional*, defaults to `True`):
                Whether or not to permute the dimensions of the image to put the channel dimension first.
        r   çp?rŒ   r�   r   )rö   r2   r3   r4   rY   r‡   r   r<   rù   Úintegerrþ   rü   Úfloat32rr   rû   )rõ   rG   rþ   Úchannel_firsts       r&   rˆ   z*ImageFeatureExtractionMixin.to_numpy_arrayx  s§   € ð 	×%Ñ% eÔ,ä�eœSŸY™YŸ_™_Ô-Ü—H‘H˜U“OˆEä˜5Ô!Ø—K‘K“MˆEà;B¸?”*˜UŸZ™Z¨™]¬B¯J©JÔ7ÐPWˆáØ—L‘L §¡¬b¯j©jÓ!9¸9ÓEˆEá˜UŸZ™Z¨1š_Ø—O‘O A q¨!Ó,ˆEàˆr%   c                 óÞ   — | j                  |«       t        |t        j                  j                  «      r|S t	        |«      r|j                  d«      }|S t        j                  |d¬«      }|S )z½
        Expands 2-dimensional `image` to 3 dimensions.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image to expand.
        r   rU   )rö   r2   r3   r4   r   Ú	unsqueezerY   Úexpand_dimsrô   s     r&   r  z'ImageFeatureExtractionMixin.expand_dims˜  s_   € ð 	×%Ñ% eÔ,ô �eœSŸY™YŸ_™_Ô-ØˆLä˜5Ô!Ø—O‘O AÓ&ˆEð ˆô —N‘N 5¨qÔ1ˆEØˆr%   c                 óÊ  — | j                  |«       t        |t        j                  j                  «      r| j	                  |d¬«      }nw|rut        |t
        j                  «      r0| j                  |j                  t
        j                  «      d«      }n+t        |«      r | j                  |j                  «       d«      }t        |t
        j                  «      r‘t        |t
        j                  «      s.t        j                  |«      j                  |j                  «      }t        |t
        j                  «      sèt        j                  |«      j                  |j                  «      }n¹t        |«      r®ddl}t        ||j                  «      s?t        |t
        j                  «      r |j                   |«      }n |j"                  |«      }t        ||j                  «      s?t        |t
        j                  «      r |j                   |«      }n |j"                  |«      }|j$                  dk(  r)|j&                  d   dv r||dd…ddf   z
  |dd…ddf   z  S ||z
  |z  S )a  
        Normalizes `image` with `mean` and `std`. Note that this will trigger a conversion of `image` to a NumPy array
        if it's a PIL Image.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image to normalize.
            mean (`list[float]` or `np.ndarray` or `torch.Tensor`):
                The mean (per channel) to use for normalization.
            std (`list[float]` or `np.ndarray` or `torch.Tensor`):
                The standard deviation (per channel) to use for normalization.
            rescale (`bool`, *optional*, defaults to `False`):
                Whether or not to rescale the image to be between 0 and 1. If a PIL image is provided, scaling will
                happen automatically.
        T)rþ   r  r   NrŒ   r‹   )rö   r2   r3   r4   rˆ   rY   rZ   rþ   rü   r  r   Úfloatr‡   rj   r;   r\   Ú
from_numpyÚtensorrr   r‘   )rõ   rG   ÚmeanÚstdrþ   r;   s         r&   Ú	normalizez%ImageFeatureExtractionMixin.normalize¬  s¿  € ð  	×%Ñ% eÔ,ä�eœSŸY™YŸ_™_Ô-Ø×'Ñ'¨°tÐ'Ó<‰Eñ Ü˜%¤§¡Ô,ØŸ™ U§\¡\´"·*±*Ó%=¸yÓI‘Ü  Ô'ØŸ™ U§[¡[£]°IÓ>�ä�eœRŸZ™ZÔ(Ü˜d¤B§J¡JÔ/Ü—x‘x “~×,Ñ,¨U¯[©[Ó9�Ü˜c¤2§:¡:Ô.Ü—h‘h˜s“m×*Ñ*¨5¯;©;Ó7‘Ü˜UÔ#Ûä˜d E§L¡LÔ1Ü˜d¤B§J¡JÔ/Ø+˜5×+Ñ+¨DÓ1‘Dà'˜5Ÿ<™<¨Ó-�DÜ˜c 5§<¡<Ô0Ü˜c¤2§:¡:Ô.Ø*˜%×*Ñ*¨3Ó/‘Cà&˜%Ÿ,™, sÓ+�Cà�:‰:˜Š?˜uŸ{™{¨1™~°Ñ7Ø˜D¢ D¨$ Ñ/Ñ/°3²q¸$À°}Ñ3EÑEÐEà˜D‘L CÑ'Ð'r%   c                 óª  — |�|nt         j                  }| j                  |«       t        |t        j
                  j
                  «      s| j                  |«      }t        |t        «      rt        |«      }t        |t        «      st        |«      dk(  r®|rt        |t        «      r||fn	|d   |d   f}n�|j                  \  }}||k  r||fn||f\  }}	t        |t        «      r|n|d   }
||
k(  r|S |
t        |
|	z  |z  «      }}|�.||
k  rt        d|› d|› �«      ‚||kD  rt        ||z  |z  «      |}}||k  r||fn||f}|j                  ||¬«      S )a›  
        Resizes `image`. Enforces conversion of input to PIL.Image.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image to resize.
            size (`int` or `tuple[int, int]`):
                The size to use for resizing the image. If `size` is a sequence like (h, w), output size will be
                matched to this.

                If `size` is an int and `default_to_square` is `True`, then image will be resized to (size, size). If
                `size` is an int and `default_to_square` is `False`, then smaller edge of the image will be matched to
                this number. i.e, if height > width, then image will be rescaled to (size * height / width, size).
            resample (`int`, *optional*, defaults to `PILImageResampling.BILINEAR`):
                The filter to user for resampling.
            default_to_square (`bool`, *optional*, defaults to `True`):
                How to convert `size` when it is a single int. If set to `True`, the `size` will be converted to a
                square (`size`,`size`). If set to `False`, will replicate
                [`torchvision.transforms.Resize`](https://pytorch.org/vision/stable/transforms.html#torchvision.transforms.Resize)
                with support for resizing only the smallest edge and providing an optional `max_size`.
            max_size (`int`, *optional*, defaults to `None`):
                The maximum allowed for the longer edge of the resized image: if the longer edge of the image is
                greater than `max_size` after being resized according to `size`, then the image is resized again so
                that the longer edge is equal to `max_size`. As a result, `size` might be overruled, i.e the smaller
                edge may be shorter than `size`. Only used if `default_to_square` is `False`.

        Returns:
            image: A resized `PIL.Image.Image`.
        r   r   zmax_size = zN must be strictly greater than the requested size for the smaller edge size = )rì   )rí   ÚBILINEARrö   r2   r3   r4   rÿ   rX   rc   r�   r³   rë   rD   Úresize)rõ   rG   rë   rì   Údefault_to_squareÚmax_sizer¦   r¥   ÚshortÚlongÚrequested_new_shortÚ	new_shortÚnew_longs                r&   r  z"ImageFeatureExtractionMixin.resizeà  sy  € ð<  (Ð3‘8Ô9K×9TÑ9Tˆà×%Ñ% eÔ,ä˜%¤§¡§¡Ô1Ø×%Ñ% eÓ,ˆEä�dœDÔ!Ü˜“;ˆDä�dœCÔ ¤C¨£I°¢NÙ Ü'1°$¼Ô'<˜˜d‘|À4ÈÁ7ÈDÐQRÉGÐBT‘à %§
¡
‘��và16¸&²˜u f™oÀvÈuÀo‘��tÜ.8¸¼sÔ.C¡dÈÈaÉÐ#àÐ/Ò/Ø �Là&9¼3Ð?RÐUYÑ?YÐ\aÑ?aÓ;b˜8�	àÐ'ØÐ#6Ò6Ü(Ø)¨(¨ð 4@Ø@D¸vðGóð ð   (Ò*Ü.1°(¸YÑ2FÈÑ2QÓ.RÐT\ 8˜	à05¸²˜	 8Ñ,ÀhÐPYÐEZ�à�|‰|˜D¨8ˆ|Ó4Ð4r%   c                 ó€  — | j                  |«       t        |t        «      s||f}t        |«      st        |t        j
                  «      rP|j                  dk(  r| j                  |«      }|j                  d   dv r|j                  dd n|j                  dd }n|j                  d   |j                  d   f}|d   |d   z
  dz  }||d   z   }|d   |d   z
  dz  }||d   z   }t        |t        j                  j                  «      r|j                  ||||f«      S |j                  d   dv }|sKt        |t        j
                  «      r|j                  ddd«      }t        |«      r|j                  ddd«      }|dk\  r!||d   k  r|dk\  r||d   k  r|d||…||…f   S |j                  dd t        |d   |d   «      t        |d   |d   «      fz   }	t        |t        j
                  «      rt	        j                   ||	¬«      }
nt        |«      r|j#                  |	«      }
|	d   |d   z
  dz  }||d   z   }|	d	   |d   z
  dz  }||d   z   }|
d||…||…f<   ||z  }||z  }||z  }||z  }|
dt        d|«      t%        |
j                  d   |«      …t        d|«      t%        |
j                  d	   |«      …f   }
|
S )
a•  
        Crops `image` to the given size using a center crop. Note that if the image is too small to be cropped to the
        size given, it will be padded (so the returned result has the size asked).

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor` of shape (n_channels, height, width) or (height, width, n_channels)):
                The image to resize.
            size (`int` or `tuple[int, int]`):
                The size to which crop the image.

        Returns:
            new_image: A center cropped `PIL.Image.Image` or `np.ndarray` or `torch.Tensor` of shape: (n_channels,
            height, width).
        r�   r   r‹   r   N.r�   )r‘   rž   )rö   r2   rc   r   rY   rZ   rr   r  r‘   rë   r3   r4   Úcroprû   Úpermuterm   Ú
zeros_likeÚ	new_zerosrl   )rõ   rG   rë   Úimage_shapeÚtopÚbottomÚleftÚrightr  Ú	new_shapeÚ	new_imageÚtop_padÚ
bottom_padÚleft_padÚ	right_pads                  r&   Úcenter_cropz'ImageFeatureExtractionMixin.center_crop#  sù  € ð 	×%Ñ% eÔ,ä˜$¤Ô&Ø˜$�<ˆDô ˜5Ô!¤Z°´r·z±zÔ%BØ�z‰z˜QŠØ×(Ñ(¨Ó/�Ø-2¯[©[¸©^¸vÑ-E˜%Ÿ+™+ a b™/È5Ï;É;ÐWYÐXYÈ?‰Kà Ÿ:™: a™=¨%¯*©*°Q©-Ð8ˆKà˜1‰~  Q¡Ñ'¨AÑ-ˆØ�t˜A‘w‘ˆØ˜A‘  a¡Ñ(¨QÑ.ˆØ�t˜A‘w‘ˆô �eœSŸY™YŸ_™_Ô-Ø—:‘:˜t S¨%°Ð8Ó9Ð9ð Ÿ™ A™¨&Ð0ˆñ Ü˜%¤§¡Ô,ØŸ™¨¨1¨aÓ0�Ü˜uÔ%ØŸ™ a¨¨AÓ.�ð �!Š8˜ +¨a¡.Ò0°T¸Q²YÀ5ÈKÐXYÉNÒCZØ˜˜c &˜j¨$¨u¨*Ð4Ñ5Ð5ð —K‘K  Ð$¬¨D°©G°[À±^Ó(DÄcÈ$ÈqÉ'ÐS^Ð_`ÑSaÓFbÐ'cÑcˆ	Ü�eœRŸZ™ZÔ(ÜŸ™ e°9Ô=‰IÜ˜UÔ#ØŸ™¨	Ó2ˆIà˜R‘= ;¨q¡>Ñ1°aÑ7ˆØ˜{¨1™~Ñ-ˆ
Ø˜b‘M K°¡NÑ2°qÑ8ˆØ˜{¨1™~Ñ-ˆ	ØAFˆ	�#�w˜zÐ)¨8°IÐ+=Ð=Ñ>àˆw‰ˆØ�'ÑˆØ�ÑˆØ�ÑˆàØ”�Q˜“œs 9§?¡?°2Ñ#6¸Ó?Ð?ÄÀQÈÃÔPSÐT]×TcÑTcÐdfÑTgÐinÓPoÐAoÐoñ
ˆ	ð Ðr%   c                 ó¬   — | j                  |«       t        |t        j                  j                  «      r| j	                  |«      }|ddd…dd…dd…f   S )a   
        Flips the channel order of `image` from RGB to BGR, or vice versa. Note that this will trigger a conversion of
        `image` to a NumPy array if it's a PIL Image.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image whose color channels to flip. If `np.ndarray` or `torch.Tensor`, the channel dimension should
                be first.
        Nrž   )rö   r2   r3   r4   rˆ   rô   s     r&   Úflip_channel_orderz.ImageFeatureExtractionMixin.flip_channel_ordern  sI   € ð 	×%Ñ% eÔ,ä�eœSŸY™YŸ_™_Ô-Ø×'Ñ'¨Ó.ˆEà‘T�r�Tš1ša�ZÑ Ð r%   c                 óø   — |�|nt         j                  j                  }| j                  |«       t	        |t         j                  j                  «      s| j                  |«      }|j                  ||||||¬«      S )aÖ  
        Returns a rotated copy of `image`. This method returns a copy of `image`, rotated the given number of degrees
        counter clockwise around its centre.

        Args:
            image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
                The image to rotate. If `np.ndarray` or `torch.Tensor`, will be converted to `PIL.Image.Image` before
                rotating.

        Returns:
            image: A rotated `PIL.Image.Image`.
        )rì   ÚexpandÚcenterÚ	translateÚ	fillcolor)r3   r4   ÚNEARESTrö   r2   rÿ   Úrotate)rõ   rG   Úanglerì   r1  r2  r3  r4  s           r&   r6  z"ImageFeatureExtractionMixin.rotate  sn   € ð  (Ð3‘8¼¿¹×9JÑ9Jˆà×%Ñ% eÔ,ä˜%¤§¡§¡Ô1Ø×%Ñ% eÓ,ˆEà�|‰|Ø˜H¨V¸FÈiÐclð ó 
ð 	
r%   r1   )NT)F)NTN)Nr   NNN)r   r    r!   Ú__doc__rö   rÿ   r  rY   rZ   r   r  r�   rþ   rˆ   r  r  r  r-  r/  r6  r$   r%   r&   rò   rò   9  sj   „ ñòóò<$ð˜RŸZ™Zð °°e¸S°jÑ0Að ÀbÇjÁjó óò@ó(2(óhA5òFIòV!ô"
r%   rò   Úannotation_formatÚsupported_annotation_formatsc                 óØ   — | |vrt        dt        › d|› �«      ‚| t        j                  u rt	        |«      st        d«      ‚| t        j
                  u rt        |«      st        d«      ‚y y )NzUnsupported annotation format: z must be one of zäInvalid COCO detection annotations. Annotations must a dict (single image) or list of dicts (batch of images) with the following keys: `image_id` and `annotations`, with the latter being a list of annotations in the COCO format.zòInvalid COCO panoptic annotations. Annotations must a dict (single image) or list of dicts (batch of images) with the following keys: `image_id`, `file_name` and `segments_info`, with the latter being a list of annotations in the COCO format.)rD   Úformatr(   r+   r¿   r,   rÂ   )r9  r:  r°   s      r&   Úvalidate_annotationsr=  ˜  s‰   € ð
 Ð <Ñ<ÜÐ:¼6¸(ÐBRÐSoÐRpÐqÓrÐràÔ,×;Ñ;Ñ;Ü/°Ô<ÜðBóð ð Ô,×:Ñ:Ñ:Ü.¨{Ô;ÜðMóð ð <ð ;r%   Úvalid_processor_keysÚcaptured_kwargsc                 ó¤   — t        |«      j                  t        | «      «      }|r+dj                  |«      }t        j	                  d|› d�«       y y )Nz, zUnused or unrecognized kwargs: rq   )ÚsetÚ
differenceÚjoinr’   r“   )r>  r?  Úunused_keysÚunused_key_strs       r&   Úvalidate_kwargsrF  ±  sJ   € Ü�oÓ&×1Ñ1´#Ð6JÓ2KÓL€KÙØŸ™ ;Ó/ˆä�‰Ð8¸Ð8HÈÐJÕKð r%   T)Úfrozenc                   ó�   — e Zd ZU dZdZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed<   d	„ Zy)
ÚSizeDictz>
    Hashable dictionary to store image size information.
    Nr¥   r¦   Úlongest_edgeÚshortest_edger¢   r£   c                 óP   — t        | |«      rt        | |«      S t        d|› d�«      ‚)NzKey z not found in SizeDict.)ÚhasattrÚgetattrÚKeyError)rõ   Úkeys     r&   Ú__getitem__zSizeDict.__getitem__Æ  s.   € Ü�4˜ÔÜ˜4 Ó%Ð%Ü˜˜c˜UÐ"9Ð:Ó;Ð;r%   )r   r    r!   r8  r¥   r   r�   Ú__annotations__r¦   rJ  rK  r¢   r£   rQ  r$   r%   r&   rI  rI  ¹  sb   … ñð !€FˆH�S‰MÓ Ø€Eˆ8�C‰=ÓØ"&€L�(˜3‘-Ó&Ø#'€M�8˜C‘=Ó'Ø $€J�˜‘Ó$Ø#€Iˆx˜‰}Ó#ó<r%   rI  )rŒ   r1   )NNNNNNNNNNNNN)^rÔ   rÐ   Úcollections.abcr   Údataclassesr   Úior   Útypingr   r   r<   rY   rÍ   Úutilsr	   r
   r   r   r   r   r   r   r   r   r   Úutils.constantsr   r   r   r   r   r   Ú	PIL.Imager3   ÚPIL.ImageOpsr4   Ú
Resamplingrí   Útorchvision.transformsr   r5  ÚNEAREST_EXACTÚBOXr  ÚHAMMINGÚBICUBICÚLANCZOSÚpil_torch_interpolation_mappingr;   Ú
get_loggerr   r’   rZ   rX   Ú
ImageInputr   r(   r.   r²   rÊ   r�   ÚAnnotationTyper7   r9   rH   rJ   rS   ra   rd   rg   Úboolrn   rs   r�   r…   rˆ   rc   r–   rš   r    r¬   rµ   r¹   r¿   rÂ   r  rÉ   rà   rð   rò   r=  rF  rI  r$   r%   r&   ú<module>rg     sA  ðó Û 	Ý $Ý !Ý ß "ã Û ÷÷ ÷ ñ ÷÷ ñ ÔÛÛàŸ™×-Ñ-ÐáÔ!Ý<ð ×&Ñ&Ð(9×(GÑ(GØ×"Ñ"Ð$5×$9Ñ$9Ø×'Ñ'Ð):×)CÑ)CØ×&Ñ&Ð(9×(AÑ(AØ×&Ñ&Ð(9×(AÑ(AØ×&Ñ&Ð(9×(AÑ(Að+
Ñ'ð +-Ð'ñ ÔÛð 
ˆ×	Ñ	˜HÓ	%€ð Ø�r—z‘z >°4Ð8IÑ3JÈDÐQS×Q[ÑQ[ÑL\Ð^bÐcqÑ^rÐrñ€
ô
�|ô ô
$�|ô $ô
9�\ô 9ð
 �c˜5  c¨4°©:Ð!5Ñ6Ð6Ñ7€òFô�ô ò?òwðE Dó Eò,ò	òð5˜2Ÿ:™:ð 5¨$ó 5ñ$°ð $¸DÀÑ<Ló $ðR ñ#LØ�$�zÑ" JÐ.Ñ/ð#Làð#Lð ó#LðP ñ$vØ�$�zÑ" JÐ.Ñ/ð$vàð$vð 
ˆ*Ñó$vðN˜2Ÿ:™:ó ð NRñ$AØ�:‰:ð$AØ%-¨e°C¸¸sÀC¸x¹Ð4HÑ.IÑ%Jð$Aàó$AðP TXñFØ�:‰:ðFØ*2°5Ð9IÈ3Ð9NÑ3OÑ*PðFàóFñ0D˜"Ÿ*™*ð D°8Ð<LÑ3Mð DÐY^Ð_bÐdgÐ_gÑYhó Dð0!Ø�c˜3�h‘ð!àð!ð ð!ð ˆ3�ˆ8�_ó	!ð>°4¸¸UÀ4ÈÀ;Ñ=OÐ8OÑ3Pð ÐUYó ð°$°s¸EÀ$ÈÀ+Ñ<NÐ7NÑ2Oð ÐTXó ð O°(¸4ÀÀUÈ4ÐQVÈ;ÑEWÐ@WÑ;XÑ2Yð OÐ^bó OðN°¸$¸sÀEÈ$ÐPUÈ+ÑDVÐ?VÑ:WÑ1Xð NÐ]aó Nñ'�e˜CÐ!2Ð2Ñ3ð '¸hÀu¹oð 'ÐYjó 'ðV TXñ3Ø�$˜˜sÐ$5Ð5Ñ6ð3ØAIÈ%Áð3à
Ð˜dÐ#4Ñ5°t¸DÐARÑ<SÑ7TÐTÑUó3ð, "&Ø&*Ø#'Ø6:Ø59Ø!Ø59Ø%)Ø*.Ø $Ø%)Ø/3Ø37ñ1lØ˜‘ð1là˜U‘Oð1lð ˜4‘.ð1lð ˜˜u d¨5¡kÐ1Ñ2Ñ3ð	1lð
 ˜˜e T¨%¡[Ð0Ñ1Ñ2ð1lð �T‰Nð1lð �u˜T # s (™^¨SÐ0Ñ1Ñ2ð1lð ˜T‘Nð1lð ˜˜S #˜X™Ñ'ð1lð ˜‰~ð1lð �4˜˜S˜‘>Ñ
"ð1lð Ð+Ñ,ð1lð Ð/Ñ0ó1l÷j\
ñ \
ð~
Ø'ðà"'Ð(8¸#Ð(=Ñ">ðð �d‘ðð 
ó	ð2L¨$¨s©)ð LÀdÈ3Áió Lñ �$Ô÷<ð <ó ñ<r%   