Ë
    ÃÓ^jYF  ã                  ó®  — d Z ddlmZ ddlZddlmZ ddl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 ddlmZ ddlmc mc mZ ddlmZ dd	lmZ g d
¢Z G d„ d«      Z  G d„ de «      Z! G d„ de «      Z" G d„ de«      Z# G d„ d«      Z$ee	 	 	 	 	 	 	 	 	 	 dd„«       «       Z%dd„Z&eedd„«       «       Z'eedd„«       «       Z(eedd„«       «       Z)d d„Z*y)!aE  Functional implementations for domain adaptation image transformations.

This module provides low-level functions and classes for performing domain adaptation
between images. It includes implementations for histogram matching, Fourier domain adaptation,
and pixel distribution matching with various normalization techniques.
é    )ÚannotationsN)Údeepcopy)ÚLiteral)Úadd_weightedÚclipÚclippedÚ
from_floatÚget_num_channelsÚpreserve_channel_dimÚto_floatÚuint8_io)ÚProtocol)ÚPCA)ÚMONO_CHANNEL_DIMENSIONS)Úadapt_pixel_distributionÚapply_histogramÚfourier_domain_adaptationc                  ó4   — e Zd Zdd„Zdd„Zd	d„Zd	d„Zd	d„Zy)
Ú
BaseScalerc                óJ   — d | _         d | _        d | _        d | _        d | _        y ©N)Údata_minÚdata_maxÚmeanÚvarÚscale)Úselfs    ú‹/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/albumentations/augmentations/mixing/domain_adaptation_functional.pyÚ__init__zBaseScaler.__init__   s%   € Ø+/ˆŒØ+/ˆŒØ'+ˆŒ	Ø&*ˆŒØ(,ˆ�
ó    c                ó   — t         ‚r   ©ÚNotImplementedError©r   Úxs     r   ÚfitzBaseScaler.fit&   ó   € Ü!Ð!r    c                ó   — t         ‚r   r"   r$   s     r   Ú	transformzBaseScaler.transform)   r'   r    c                óF   — | j                  |«       | j                  |«      S r   )r&   r)   r$   s     r   Úfit_transformzBaseScaler.fit_transform,   s   € Ø�‰�ŒØ�~‰~˜aÓ Ð r    c                ó   — t         ‚r   r"   r$   s     r   Úinverse_transformzBaseScaler.inverse_transform0   r'   r    N©ÚreturnÚNone©r%   ú
np.ndarrayr/   r0   ©r%   r2   r/   r2   )Ú__name__Ú
__module__Ú__qualname__r   r&   r)   r+   r-   © r    r   r   r      s   „ ó-ó"ó"ó!ô"r    r   c                  ó:   ‡ — e Zd Zddˆ fd„Zdd„Zdd„Zdd„Zˆ xZS )	ÚMinMaxScalerc                óX   •— t         ‰| �  «        |d   | _        |d   | _        d | _        y )Nr   é   )Úsuperr   ÚminÚmaxÚ
data_range)r   Úfeature_rangeÚ	__class__s     €r   r   zMinMaxScaler.__init__5   s-   ø€ Ü‰ÑÔØ'¨Ñ*ˆŒØ'¨Ñ*ˆŒØ-1ˆ�r    c                óè   — t        j                  |d¬«      | _        t        j                  |d¬«      | _        | j                  | j                  z
  | _        d| j
                  | j
                  dk(  <   y ©Nr   ©Úaxisr;   )Únpr=   r   r>   r   r?   r$   s     r   r&   zMinMaxScaler.fit;   sQ   € ÜŸ™˜q qÔ)ˆŒÜŸ™˜q qÔ)ˆŒØŸ-™-¨$¯-©-Ñ7ˆŒà01ˆ�‰˜Ÿ™¨1Ñ,Ò-r    c                ó°  — | j                   �| j                  �| j                  €t        d«      ‚t	        j
                  || j                   «      j                  t        «      }t	        j                  || j                  |¬«       t	        j                  || j                  | j                  z
  |¬«       t	        j                  || j                  |¬«       |S )NúpThis MinMaxScaler instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.)Úout)r   r   r?   Ú
ValueErrorrF   ÚsubtractÚastypeÚfloatÚdivideÚmultiplyr>   r=   Úadd©r   r%   Úx_stds      r   r)   zMinMaxScaler.transformB   sœ   € Ø�=‰=Ð  D§M¡MÐ$9¸T¿_¹_Ð=TÜðUóð ô
 —‘˜A˜tŸ}™}Ó-×4Ñ4´UÓ;ˆÜ
�	‰	�%˜Ÿ™¨eÕ4Ü
�‰�E˜DŸH™H t§x¡xÑ/°eÕ<Ü
�‰ˆu�d—h‘h EÕ*àˆr    c                ó  — | j                   �| j                  �| j                  €t        d«      ‚|| j                  z
  | j
                  | j                  z
  z  j                  t        «      }|| j                  z  | j                   z   S )NrH   )r   r   r?   rJ   r=   r>   rL   rM   rQ   s      r   r-   zMinMaxScaler.inverse_transformP   su   € Ø�=‰=Ð  D§M¡MÐ$9¸T¿_¹_Ð=TÜðUóð ð �d—h‘h‘, 4§8¡8¨d¯h©hÑ#6Ñ7×?Ñ?ÄÓFˆØ�t—‘Ñ&¨¯©Ñ6Ð6r    ))g        g      ð?)r@   ztuple[float, float]r/   r0   r1   r3   ©r4   r5   r6   r   r&   r)   r-   Ú__classcell__©rA   s   @r   r9   r9   4   s   ø„ ö2ó2ó÷7r    r9   c                  ó8   ‡ — e Zd Zdˆ fd„Zdd„Zdd„Zdd„Zˆ xZS )ÚStandardScalerc                ó"   •— t         ‰| �  «        y r   )r<   r   )r   rA   s    €r   r   zStandardScaler.__init__[   s   ø€ Ü‰ÑÕr    c                óô   — t        j                  |d¬«      | _        t        j                  |d¬«      | _        t        j                  | j                  «      | _        d| j                  | j                  dk(  <   y rC   )rF   r   r   Úsqrtr   r$   s     r   r&   zStandardScaler.fit^   sP   € Ü—G‘G˜A AÔ&ˆŒ	Ü—6‘6˜! !Ô$ˆŒÜ—W‘W˜TŸX™XÓ&ˆŒ
à&'ˆ�
‰
�4—:‘: ‘?Ò#r    c                ó€   — | j                   �| j                  €t        d«      ‚|| j                   z
  | j                  z  S ©NzrThis StandardScaler instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.©r   r   rJ   r$   s     r   r)   zStandardScaler.transforme   sA   € Ø�9‰9Ð §
¡
Ð 2ÜðUóð ð �D—I‘I‘ §¡Ñ+Ð+r    c                ó€   — | j                   �| j                  €t        d«      ‚|| j                  z  | j                   z   S r]   r^   r$   s     r   r-   z StandardScaler.inverse_transformm   sA   € Ø�9‰9Ð §
¡
Ð 2ÜðUóð ð �D—J‘J‘ $§)¡)Ñ+Ð+r    r.   r1   r3   rT   rV   s   @r   rX   rX   Z   s   ø„ õó(ó,÷,r    rX   c                  ó‚   — e Zd Zej                  dd„«       Zej                  ddd„«       Zej                  ddd„«       Zy)ÚTransformerInterfacec                 ó   — y r   r7   r$   s     r   r-   z&TransformerInterface.inverse_transformw   s   € Ø>Ar    Nc                 ó   — y r   r7   ©r   r%   Úys      r   r&   zTransformerInterface.fitz   s   € ØMPr    c                 ó   — y r   r7   rd   s      r   r)   zTransformerInterface.transform}   s   € ØSVr    r3   r   )r%   r2   re   znp.ndarray | Noner/   r2   )r4   r5   r6   ÚabcÚabstractmethodr-   r&   r)   r7   r    r   ra   ra   v   s>   „ Ø×ÑÚAó ØAà×ÑÛPó ØPà×ÑÛVó ÙVr    ra   c                  ó\   — e Zd Z	 d		 	 	 	 	 d
d„Zdd„Zdd„Zdd„Zdd„Zedd„«       Z	dd„Z
y)ÚDomainAdapterc                óÄ   — |\  | _         | _        t        |«      | _        || _        t        |«      | _        | j                  j                  | j                  |«      «       y r   )	Úcolor_inÚ	color_outr   Úsource_transformerÚtarget_transformerr
   Únum_channelsr&   Úflatten)r   ÚtransformerÚref_imgÚcolor_conversionss       r   r   zDomainAdapter.__init__‚   sQ   € ð ):Ñ%ˆŒ�t”~Ü"*¨;Ó"7ˆÔØ"-ˆÔÜ,¨WÓ5ˆÔØ×Ñ×#Ñ# D§L¡L°Ó$9Õ:r    c                ó^   — | j                   €|S t        j                  || j                   «      S r   )rl   Úcv2ÚcvtColor©r   Úimgs     r   Úto_colorspacezDomainAdapter.to_colorspaceŽ   s%   € Ø—m‘mÐ+ˆsÐQ´·±¸cÀ4Ç=Á=Ó1QÐQr    c                ó’   — | j                   €|S t        j                  t        |t        j
                  d¬«      | j                   «      S )NT©Úinplace)rm   rv   rw   r   rF   Úuint8rx   s     r   Úfrom_colorspacezDomainAdapter.from_colorspace‘   s3   € Ø�>‰>Ð!ØˆJÜ�|‰|œD ¤b§h¡h¸Ô=¸t¿~¹~ÓNÐNr    c                ór   — | j                  |«      }t        |«      }|j                  d| j                  «      S )Néÿÿÿÿ)rz   r   Úreshaperp   rx   s     r   rq   zDomainAdapter.flatten–   s2   € Ø× Ñ  Ó%ˆÜ�s‹mˆØ�{‰{˜2˜t×0Ñ0Ó1Ð1r    c                óò   — t        |t        j                  d¬«      }| j                  dk(  r!| j	                  |j                  ||«      «      S | j	                  |j                  ||| j                  «      «      S )NTr|   r;   )r   rF   r~   rp   r   r‚   )r   ÚpixelsÚheightÚwidths       r   ÚreconstructzDomainAdapter.reconstruct›   sb   € Ü�fœbŸh™h°Ô5ˆØ×Ñ Ò!Ø×'Ñ'¨¯©°v¸uÓ(EÓFÐFØ×#Ñ# F§N¡N°6¸5À$×BSÑBSÓ$TÓUÐUr    c                óf   — t        j                  t        j                  | j                  «      «      S r   )rF   ÚsignÚtraceÚcomponents_)r%   s    r   Ú	_pca_signzDomainAdapter._pca_sign¡   s   € ä�w‰w”r—x‘x §¡Ó.Ó/Ð/r    c                ó  — |j                   d d \  }}| j                  |«      }| j                  j                  |«       t	        | j
                  d«      rlt	        | j                  d«      rV| j                  | j
                  «      | j                  | j                  «      k7  r| j
                  xj                  dz  c_        | j                  j                  |«      }| j
                  j                  |«      }| j                  |||«      S )Né   r‹   r�   )Úshaperq   rn   r&   Úhasattrro   rŒ   r‹   r)   r-   r‡   )r   Úimager…   r†   r„   ÚrepresentationÚresults          r   Ú__call__zDomainAdapter.__call__¥   s×   € ØŸ™ B Q˜‰ˆ�Ø—‘˜eÓ$ˆØ×Ñ×#Ñ# FÔ+ô �D×+Ñ+¨]Ô;Ü˜×/Ñ/°Ô?Ø—‘˜t×6Ñ6Ó7¸4¿>¹>È$×JaÑJaÓ;bÒbà×#Ñ#×/Ò/°2Ñ5Õ/à×0Ñ0×:Ñ:¸6ÓBˆØ×(Ñ(×:Ñ:¸>ÓJˆØ×Ñ ¨°Ó6Ð6r    N))NN)rr   ra   rs   r2   rt   ztuple[None, None])ry   r2   r/   r2   )r„   r2   r…   Úintr†   r•   r/   r2   r3   )r‘   r2   r/   r2   )r4   r5   r6   r   rz   r   rq   r‡   ÚstaticmethodrŒ   r”   r7   r    r   rj   rj   �   sX   „ ð
 0<ð	
;à)ð
;ð ð
;ð -ó	
;óRóOó
2ó
Vð ò0ó ð0ô7r    rj   c                ó^  — | j                   |j                   k7  rt        d«      ‚t        | «      }t        |«      }||k7  rt        d«      ‚|dk(  r*t        j                  | «      } t        j                  |«      }| j
                  |j
                  k7  r3t        j                  || j
                  dd t        j                  ¬«      }| j                   }|t        j                  k(  r4t        | t        j                  «      } t        |t        j                  «      }t        t        t        dœ|   «       }t        ||¬«      } || «      j!                  t        j                  «      }	| j!                  t        j                  «      d|z
  z  |	|z  z   }
|t        j                  k(  r|
S t#        |
«      S )	a’  Adapt the pixel distribution of an image to match a reference image.

    This function adapts the pixel distribution of an image to match a reference image
    using a specified transformation type and weight.

    Args:
        img (np.ndarray): The input image to be adapted.
        ref (np.ndarray): The reference image.
        transform_type (Literal["pca", "standard", "minmax"]): The type of transformation to use.
        weight (float): The weight of the transformation.

    Returns:
        np.ndarray: The adapted image.

    Raises:
        ValueError: If the input image and reference image have different dtypes or numbers of channels.

    z9Input image and reference image must have the same dtype.zFInput image and reference image must have the same number of channels.r;   NrŽ   )ÚdsizeÚinterpolation)ÚpcaÚstandardÚminmax)rr   rs   )ÚdtyperJ   r
   rF   Úsqueezer�   rv   ÚresizeÚ
INTER_AREAÚfloat32r	   r~   r   rX   r9   rj   rL   r   )ry   ÚrefÚtransform_typeÚweightÚimg_num_channelsÚref_num_channelsÚoriginal_dtyperr   ÚadapterÚtransformedr“   s              r   r   r   ¶   sK  € ð4 ‡y�y�C—I‘IÒÜÐTÓUÐUÜ'¨Ó,ÐÜ'¨Ó,ÐàÐ+Ò+ÜÐaÓbÐbà˜1ÒÜ�j‰j˜‹oˆÜ�j‰j˜‹oˆà
‡y�y�C—I‘IÒÜ�j‰j˜ C§I¡I¨b¨q MÄÇÁÔPˆà—Y‘Y€NàœŸ™Ò#Ü˜œbŸh™hÓ'ˆÜ˜œbŸh™hÓ'ˆä¬>Ä\ÑRÐSaÑbÓd€KÜ¨¸SÔA€GÙ˜#“,×%Ñ%¤b§j¡jÓ1€Kà�Z‰ZœŸ
™
Ó# q¨6¡zÑ2°[À6Ñ5IÑI€Fà#¤r§x¡xÒ/ˆ6ÐE´X¸fÓ5EÐEr    c                óš  — | j                   d d }t        t        j                  t	        |«      |z  «      «      }t        j                  |«      \  }}|\  }}t        dt        ||z
  «      «      t	        t        ||z   «      |«      }
}	t        dt        ||z
  «      «      t	        t        ||z   «      |«      }}||	|
…||…f   | |	|
…||…f<   | S )NrŽ   r   )r�   r•   rF   Úfloorr=   Ú
fgeometricÚcenterr>   )Úamp_srcÚamp_trgÚbetaÚimage_shapeÚborderÚcenter_xÚcenter_yr…   r†   Úh1Úh2Úw1Úw2s                r   Úlow_freq_mutater¹   î   sÏ   € Ø—-‘-  Ð#€Kä”—‘œ#˜kÓ*¨TÑ1Ó2Ó3€Fä#×*Ñ*¨;Ó7Ñ€Hˆhà�M€FˆEä�”C˜ 6Ñ)Ó*Ó+¬S´°XÀÑ5FÓ1GÈÓ-Pˆ€BÜ�”C˜ 6Ñ)Ó*Ó+¬S´°XÀÑ5FÓ1GÈÓ-Oˆ€BØ# B r E¨2¨b¨5 LÑ1€GˆBˆrˆE�2�b�5ˆLÑØ€Nr    c                óV  — | j                  t        j                  «      }|j                  t        j                  «      }|j                  t        k(  rt        j
                  |d¬«      }|j                  t        k(  rt        j
                  |d¬«      }|j                  d   }t        j                  |«      }t        |«      D �]c  }t        j                  j                  |dd…dd…|f   «      }t        j                  j                  |dd…dd…|f   «      }	t        j                  j                  |«      }
t        j                  j                  |	«      }t        j                  |
«      t        j                  |
«      }}t        j                  |«      }t        |j                  «       ||«      }t        j                  j!                  |t        j"                  d|z  «      z  «      }t        j                  j%                  |«      }t        j&                  |«      |dd…dd…|f<   �Œf |S )aÄ
  Apply Fourier Domain Adaptation to the input image using a target image.

    This function performs domain adaptation in the frequency domain by modifying the amplitude
    spectrum of the source image based on the target image's amplitude spectrum. It preserves
    the phase information of the source image, which helps maintain its content while adapting
    its style to match the target image.

    Args:
        img (np.ndarray): The source image to be adapted. Can be grayscale or RGB.
        target_img (np.ndarray): The target image used as a reference for adaptation.
            Should have the same dimensions as the source image.
        beta (float): The adaptation strength, typically in the range [0, 1].
            Higher values result in stronger adaptation towards the target image's style.

    Returns:
        np.ndarray: The adapted image with the same shape and type as the input image.

    Raises:
        ValueError: If the source and target images have different shapes.

    Note:
        - Both input images are converted to float32 for processing.
        - The function handles both grayscale (2D) and color (3D) images.
        - For grayscale images, an extra dimension is added to facilitate uniform processing.
        - The adaptation is performed channel-wise for color images.
        - The output is clipped to the valid range and preserves the original number of channels.

    The adaptation process involves the following steps for each channel:
    1. Compute the 2D Fourier Transform of both source and target images.
    2. Shift the zero frequency component to the center of the spectrum.
    3. Extract amplitude and phase information from the source image's spectrum.
    4. Mutate the source amplitude using the target amplitude and the beta parameter.
    5. Combine the mutated amplitude with the original phase.
    6. Perform the inverse Fourier Transform to obtain the adapted channel.

    The `low_freq_mutate` function (not shown here) is responsible for the actual
    amplitude mutation, focusing on low-frequency components which carry style information.

    Example:
        >>> import numpy as np
        >>> import albumentations as A
        >>> source_img = np.random.rand(100, 100, 3).astype(np.float32)
        >>> target_img = np.random.rand(100, 100, 3).astype(np.float32)
        >>> adapted_img = A.fourier_domain_adaptation(source_img, target_img, beta=0.5)
        >>> assert adapted_img.shape == source_img.shape

    References:
        FDA: Fourier Domain Adaptation for Semantic Segmentation: Yang and Soatto, 2020, CVPR
            https://openaccess.thecvf.com/content_CVPR_2020/papers/Yang_FDA_Fourier_Domain_Adaptation_for_Semantic_Segmentation_CVPR_2020_paper.pdf

    r�   rD   Ny              ð?)rL   rF   r¡   Úndimr   Úexpand_dimsr�   Ú
zeros_likeÚrangeÚfftÚfft2ÚfftshiftÚabsÚangler¹   ÚcopyÚ	ifftshiftÚexpÚifft2Úreal)ry   Ú
target_imgr°   Úsrc_imgÚtrg_imgrp   Ú
src_in_trgÚ
channel_idÚfft_srcÚfft_trgÚfft_src_shiftedÚfft_trg_shiftedr®   Úpha_srcr¯   Úmutated_ampÚfft_src_mutatedÚsrc_in_trg_channels                     r   r   r   ý   sž  € ðl �j‰jœŸ™Ó$€GØ×Ñ¤§
¡
Ó+€Gà‡|�|Ô.Ò.Ü—.‘. ¨rÔ2ˆØ‡|�|Ô.Ò.Ü—.‘. ¨rÔ2ˆà—=‘= Ñ$€Lô —‘˜wÓ'€Jä˜LÓ)ó Cˆ
ä—&‘&—+‘+˜g¢aª¨JÐ&6Ñ7Ó8ˆÜ—&‘&—+‘+˜g¢aª¨JÐ&6Ñ7Ó8ˆô Ÿ&™&Ÿ/™/¨'Ó2ˆÜŸ&™&Ÿ/™/¨'Ó2ˆô Ÿ6™6 /Ó2´B·H±H¸_Ó4M�ˆÜ—&‘&˜Ó)ˆô & g§l¡l£n°g¸tÓDˆô Ÿ&™&×*Ñ*¨;¼¿¹ÀÀWÁÓ9MÑ+MÓNˆô  ŸV™VŸ\™\¨/Ó:Ðô (*§w¡wÐ/AÓ'Bˆ
’1’a˜Ð#Ó$ð/Cð2 Ðr    c                ó4  — | j                   dd |j                   dd k7  r3t        j                  || j                   d   | j                   d   f¬«      }t        j                  | «      } t        j                  |«      }t        | |«      }t        ||| d|z
  «      S )a–  Apply histogram matching to an input image using a reference image and blend the result.

    This function performs histogram matching between the input image and a reference image,
    then blends the result with the original input image based on the specified blend ratio.

    Args:
        img (np.ndarray): The input image to be transformed. Can be either grayscale or RGB.
            Supported dtypes: uint8, float32 (values should be in [0, 1] range).
        reference_image (np.ndarray): The reference image used for histogram matching.
            Should have the same number of channels as the input image.
            Supported dtypes: uint8, float32 (values should be in [0, 1] range).
        blend_ratio (float): The ratio for blending the matched image with the original image.
            Should be in the range [0, 1], where 0 means no change and 1 means full histogram matching.

    Returns:
        np.ndarray: The transformed image after histogram matching and blending.
            The output will have the same shape and dtype as the input image.

    Supported image types:
        - Grayscale images: 2D arrays
        - RGB images: 3D arrays with 3 channels
        - Multispectral images: 3D arrays with more than 3 channels

    Note:
        - If the input and reference images have different sizes, the reference image
          will be resized to match the input image's dimensions.
        - The function uses a custom implementation of histogram matching based on OpenCV and NumPy.
        - The @clipped and @preserve_channel_dim decorators ensure the output is within
          the valid range and maintains the original number of dimensions.

    NrŽ   r;   r   )r˜   )r�   rv   rŸ   rF   rž   Úmatch_histogramsr   )ry   Úreference_imageÚblend_ratioÚmatcheds       r   r   r   \  sŠ   € ðF ‡y�y��!€}˜×-Ñ-¨b¨qÐ1Ò1ÜŸ*™* _¸S¿Y¹YÀq¹\È3Ï9É9ÐUVÉ<Ð<XÔYˆä
�*‰*�S‹/€CÜ—j‘j Ó1€Oô ˜s OÓ4€Gô ˜ ¨c°1°{±?ÓCÐCr    c                ód  — |j                   t        j                  k7  rt        |t        j                  «      }| j                  |j                  k7  rt        d«      ‚| j                  dk(  rt        j                  | d¬«      } |j                  dk(  rt        j                  |d¬«      }t        j                  | j                  t        j                  ¬«      }| j                  d   }t        |«      D ]<  }t        | d|f   |d|f   «      j                  t        j                  «      }||d|f<   Œ> |S )a¹  Adjust an image so that its cumulative histogram matches that of another.

    The adjustment is applied separately for each channel.

    Args:
        image (np.ndarray): Input image. Can be gray-scale or in color.
        reference (np.ndarray): Image to match histogram of. Must have the same number of channels as image.
        channel_axis (int | None): If None, the image is assumed to be a grayscale (single channel) image.
            Otherwise, this indicates which axis of the array corresponds to channels.

    Returns:
        np.ndarray: Transformed input image.

    Raises:
        ValueError: Thrown when the number of channels in the input image and the reference differ.

    z<Image and reference must have the same number of dimensions.rŽ   r�   rD   )r�   .)r�   rF   r~   r	   r»   rJ   r¼   Úemptyr�   r¾   Ú_match_cumulative_cdfrL   )r‘   Ú	referencerÚ   rp   ÚchannelÚmatched_channels         r   r×   r×   Œ  sø   € ð( ‡�œ"Ÿ(™(Ò"Ü˜y¬"¯(©(Ó3ˆ	à‡z�z�Y—^‘^Ò#ÜÐWÓXÐXð ‡z�z�Q‚Ü—‘˜u¨2Ô.ˆØ‡~�~˜ÒÜ—N‘N 9°2Ô6ˆ	ä�h‰h�u—{‘{¬"¯(©(Ô3€Gà—;‘;˜r‘?€Lä˜Ó&ò 0ˆÜ/°°c¸7°lÑ0CÀYÈsÐT[È|ÑE\Ó]×dÑdÔeg×emÑemÓnˆØ /ˆ��W�Òð0ð €Nr    c                óü  — | j                  d«      }t        j                  |«      }t        j                  |j                  d«      «      }t        j                  |«      d   }||   }t        j                  |«      | j
                  z  }t        j                  |«      |j
                  z  }t        j                  |||«      }||   j                  | j                  «      j                  t        j                  «      S )Nr�   r   )
r‚   rF   ÚbincountÚnonzeroÚcumsumÚsizeÚinterpr�   rL   r~   )	ÚsourceÚtemplateÚ
src_lookupÚ
src_countsÚtmpl_countsÚtmpl_valuesÚsrc_quantilesÚtmpl_quantilesÚinterp_a_valuess	            r   rÝ   rÝ   ·  sÁ   € Ø—‘ Ó#€JÜ—‘˜ZÓ(€JÜ—+‘+˜h×.Ñ.¨rÓ2Ó3€Kô —*‘*˜[Ó)¨!Ñ,€KØ˜kÑ*€Kô —I‘I˜jÓ)¨F¯K©KÑ7€MÜ—Y‘Y˜{Ó+¨h¯m©mÑ;€Nä—i‘i ¨~¸{ÓK€OØ˜:Ñ&×.Ñ.¨v¯|©|Ó<×CÑCÄBÇHÁHÓMÐMr    )
ry   r2   r¢   r2   r£   z$Literal['pca', 'standard', 'minmax']r¤   rM   r/   r2   )r®   r2   r¯   r2   r°   rM   r/   r2   )ry   r2   rÉ   r2   r°   rM   r/   r2   )ry   r2   rØ   r2   rÙ   rM   r/   r2   )r‘   r2   rÞ   r2   r/   r2   )rç   r2   rè   r2   r/   r2   )+Ú__doc__Ú
__future__r   rg   rÄ   r   Útypingr   rv   ÚnumpyrF   Úalbucorer   r   r   r	   r
   r   r   r   Útyping_extensionsr   Ú1albumentations.augmentations.geometric.functionalÚaugmentationsÚ	geometricÚ
functionalr¬   Ú"albumentations.augmentations.utilsr   Ú$albumentations.core.type_definitionsr   Ú__all__r   r9   rX   ra   rj   r   r¹   r   r   r×   rÝ   r7   r    r   ú<module>rý      s1  ðñõ #ã 
Ý Ý ã 
Û ß x× xÓ xÝ &ç FÓ FÝ 2Ý Hò€÷"ñ "ô,#7�:ô #7ôL,�Zô ,ô8W˜8ô W÷27ñ 27ðj 	Øð3FØ	ð3Fà	ð3Fð 9ð3Fð ð	3Fð
 ò3Fó ó 	ð3Fólð 	ØòZó ó 	ðZðz 	Øò+Dó ó 	ð+Dð\ 
Øò&ó ó 
ð&ôRNr    