§
    ’©ºj¨
  ã                   ó€   — d dl mZ d dlZd dlmZmZ d dlmZ d dlmZ 	 ddeded	e	d
eee
eeef         f         fd„ZdS )é    )ÚUnionN)ÚTensorÚlinalg)Ú_check_same_shape)Úrank_zero_warnFÚpoint_cloud1Úpoint_cloud2Ú
return_allÚreturnc                 ó   — t          | |¦  «         | j        dk    rt          d| j        › d�¦  «        ‚| |                      dd¬¦  «        z
  } ||                     dd¬¦  «        z
  }| t	          j        | ddgd¬¦  «        z  } |t	          j        |ddgd¬¦  «        z  }	 t	          j        t          j        | 	                    dd¦  «        | ¦  «         	                    dd¦  «        d¬	¦  «        \  }}}n�# t          $ rt}t          d
|› d�t          ¦  «         t          j        d¦  «        t          j        | j        d         ¦  «        t          j        | j        d         ¦  «        fcY d}~S d}~ww xY wt          j        ||¦  «        }|                     dd¬¦  «        }|dd…df         t          j        || 	                    dd¦  «        ¦  «        z  }| |z
                       ¦   «                              ddg¬¦  «        }	|r|	||fS |	S )aZ  Runs procrustrus analysis on a batch of data points.

    Works similar ``scipy.spatial.procrustes`` but for batches of data points.

    Args:
        point_cloud1: The first set of data points
        point_cloud2: The second set of data points
        return_all: If True, returns the scale and rotation matrices along with the disparity

    é   z®Expected both datasets to be 3D tensors of shape (N, M, D), where N is the batch size, M is the number of data points and D is the dimensionality of the data points, but got z dimensions.é   T)ÚdimÚkeepdimé   F)Úfull_matricesz>SVD calculation in procrustes_disparity failed with exception z4. Returning 0 disparity and identity scale/rotation.g        r   N)r   )r   )r   ÚndimÚ
ValueErrorÚmeanr   ÚnormÚsvdÚtorchÚmatmulÚ	transposeÚ	Exceptionr   ÚUserWarningÚtensorÚonesÚshapeÚeyeÚsumÚsquare)
r   r	   r
   ÚuÚwÚvÚexÚrotationÚscaleÚ	disparitys
             úx/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/torchmetrics/functional/shape/procrustes.pyÚprocrustes_disparityr+      sb  € õ �l LÑ1Ô1Ð1ØÔ˜AÒÐÝðtØT`ÔTeðtð tð tñ
ô 
ð 	
ð
   ,×"3Ò"3¸À4Ð"3Ñ"HÔ"HÑH€LØ ,×"3Ò"3¸À4Ð"3Ñ"HÔ"HÑH€LØ•F”K °1°a°&À$ÐGÑGÔGÑG€LØ•F”K °1°a°&À$ÐGÑGÔGÑG€Lð
fÝ”*ÝŒL˜×/Ò/°°1Ñ5Ô5°|ÑDÔD×NÒNÈqÐRSÑTÔTÐdið
ñ 
ô 
‰ˆˆ1ˆaˆaøõ ð fð fð fÝðÈRð ð ð åñ	
ô 	
ð 	
õ
 Œ|˜CÑ Ô ¥%¤*¨\Ô-?ÀÔ-BÑ"CÔ"CÅUÄYÈ|ÔOaÐbcÔOdÑEeÔEeÐeÐeÐeÐeÐeÐeÐeøøøøðføøøõ Œ|˜A˜qÑ!Ô!€HØ�EŠE�!˜TˆEÑ"Ô"€EØ˜˜˜˜D˜”>¥E¤L°¸x×?QÒ?QÐRSÐUVÑ?WÔ?WÑ$XÔ$XÑX€LØ Ñ,×4Ò4Ñ6Ô6×:Ò:ÀÀ1¸vÐ:ÑFÔF€IØð *Ø˜% Ð)Ð)ØÐs    Â!AC7 Ã7
E5ÄA)E0Å*E5Å0E5)F)Útypingr   r   r   r   Útorchmetrics.utilities.checksr   Útorchmetrics.utilities.printsr   ÚboolÚtupler+   © ó    r*   ú<module>r3      s¾   ðð Ð Ð Ð Ð Ð à €€€Ø  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8ð DIð+ð +Øð+Ø(.ð+Ø<@ð+à
ˆ6�5˜ ¨Ð/Ô0Ð0Ô1ð+ð +ð +ð +ð +ð +r2   