+
    ÿäûjÍh  ã                  ó®  € R t ^ RIHt ^ RIt^ RIt^ RIHtHtHt ^ RI	H
t
 ^ RIHt ^ RIHtHtHtHtHt ^ RIt^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RI H!t! ^ RI"H#t# ^ RI$H%t% ^ RI&H't' ^ RI(H)t) ^ RI*H+t+ ]'       d   ^ RI,H-t- . R<Ot.]! R4      t/]'P`                  R]'Pb                  R]'Pd                  R/t3R R lt4R R lt5]! RR 7       ! R! R4      4       t6]! RR 7       ! R" R4      4       t7]! RR 7       ! R# R4      4       t8R$ R% lt9R=R& R' llt:R>R( R) llt;R* R+ lt<R, R- lt=R. R/ lt>R0 R1 lt?R2 R3 lt@R4RR5RR6R7R8R9/R: R; lltAR# )?aÊ  Audit one augmentation pipeline call: operation order, parameters, matrices and label round trips.

:func:`audit` runs a 2D :class:`~kornia.augmentation.container.AugmentationSequential` once and returns its ordinary
outputs with a report; the ordinary forward call is unchanged and records nothing. :ref:`augmentation-audit` explains
how to read the report and lists the pipelines it supports.

Which function or class to use:

- Run a pipeline once and get its outputs plus a report: :func:`audit`.
- Read the report: :class:`AugmentationAuditReport`; one executed operation in it: :class:`AugmentationAuditStep`;
  the out-of-frame and round-trip statistics of one keypoint or box input: :class:`SpatialAudit`.
)ÚannotationsN)Ú	dataclassÚfieldsÚis_dataclass)ÚEnum)Úpartial)ÚTYPE_CHECKINGÚAnyÚLiteralÚTypeVarÚcast)ÚTensorÚnn)ÚGeometricAugmentationBase2D)ÚIntensityAugmentationBase2D)ÚAugmentationBase3D)ÚImageSequential)ÚDataType)Ú	ParamItem)ÚPatchSequential)ÚVideoSequential)ÚDataKey)ÚBoxes)Ú	Keypoints©ÚAugmentationSequentialÚAugmentationAuditReportÚAugmentationAuditStepÚSpatialAuditÚ_TÚvertices_plusÚ	xyxy_plusÚxywhc               ó    € V ^8„  d   QhRRRR/# )é   Úvaluer   Úreturn© )Úformats   "Ú]C:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\contrib\augmentation_audit.pyÚ__annotate__r*   @   s   € ÷ 	ñ 	�Rð 	˜Bñ 	ó    c                óX  € \        V \        4      '       d-   \        \        V P	                  4       P                  4       4      # \        V \        4      '       d8   \        \        \        V P                  \        V P                  4      4      4      # \        V \        4      '       d=   \        \        V P                  4        UUu/ uF  w  rV\        V4      bK  	  upp4      # \        V \        \        34      '       d'   \        \        \        V 4      ! R  V  4       4      4      # V # u uppi )c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5i©N)Ú	_snapshot)Ú.0Úitems   & r)   Ú	<genexpr>Ú_snapshot.<locals>.<genexpr>H   s   é € Ð#FÁ¸¤I¨d§O OÃùs   ‚)Ú
isinstancer   r   r   ÚdetachÚcloner   Únamer/   ÚdataÚdictÚitemsÚtupleÚlistÚtype)r%   Úkeyr1   s   &  r)   r/   r/   @   sË   € Ü�%œ× Ò Ü”B˜Ÿ™›×,Ñ,Ó.Ó/Ð/Ü�%œ×#Ò#Ü”Bœ	 %§*¡*¬i¸¿
¹
Ó.CÓDÓEÐEÜ�%œ×ÒÜ”B¸u¿{¹{¼}ÔM¹}±)°#˜œi¨›oÒ-¹}ÒMÓNÐNÜ�%œ%¤˜×'Ò'Ü”Bœ˜UœÑ#FÁÓ#FÓFÓGÐGØ€Lùó Ns   ÃD&c               ó    € V ^8„  d   QhRRRR/# )r$   r%   r	   r&   r'   )r(   s   "r)   r*   r*   L   s   € ÷ dñ d�sð d˜sñ dr+   c           
     óT  € \        V \        4      '       dw   R \        V P                  4       P	                  4       P                  4       4      R\        V P                  4      R\        V P                  4      R\        V P                  4      /# \        V \        4      '       d$   RV P                  R\        V P                  4      /# \        V 4      '       dX   \        V \        4      '       gB   \!        V 4       Uu/ uF+  qP                  \        \#        WP                  4      4      bK-  	  up# \        V \$        4      '       d   V P                  # \        V \&        4      '       dA   V P)                  4        UUu/ uF#  w  r#\        \        V4      4      \        V4      bK%  	  upp# \        V \        \*        34      '       d   V  Uu. uF  p\        V4      NK  	  up# \        V \,        4      '       d   \.        P0                  ! V 4      '       g   R# V e'   \        V \        \2        \4        \,        34      '       d   V # \        V \6        P                  \6        P                  34      '       d   \        V 4      # \9        R\        V 4      P:                   R24      hu upi u uppi u upi )	ÚvaluesÚshapeÚdtypeÚdevicer7   r8   NzAudit metadata of type z cannot be serialized to JSON.)r4   r   Ú_json_valuer5   ÚcpuÚtolistr<   rB   ÚstrrC   rD   r   r7   r8   r   r=   r   Úgetattrr   r9   r:   r;   ÚfloatÚmathÚisfiniteÚboolÚintÚtorchÚ	TypeErrorÚ__name__)r%   Úfieldr>   r1   s   &   r)   rE   rE   L   sê  € Ü�%œ× Ò à”k %§,¡,£.×"4Ñ"4Ó"6×"=Ñ"=Ó"?Ó@Ø”T˜%Ÿ+™+Ó&Ø”S˜Ÿ™Ó%Ø”c˜%Ÿ,™,Ó'ð	
ð 	
ô �%œ×#Ò#Ø˜Ÿ
™
 F¬K¸¿
¹
Ó,CÐDÐDÜ�E×Ò¤:¨e´T×#:Ò#:ÜQWÐX]ÔQ^Ó_ÑQ^È—
‘
œK¬°·z±zÓ(BÓCÒCÑQ^Ñ_Ð_Ü�%œ×ÒØ�z‰zÐÜ�%œ×ÒØJOÏ+É+Ì-ÔXÉ-¹Y¸S””K Ó$Ó%¤{°4Ó'8Ò8É-ÒXÐXÜ�%œ$¤˜×'Ò'Ù.3Ó4©e d”˜DÖ!©eÑ4Ð4Ü�%œ×Ò¬¯ª°e×(<Ò(<ÙØ‚}œ
 5¬3´´c¼5Ð*A×BÒBØˆÜ�%œ%Ÿ+™+¤u§|¡|Ð4×5Ò5Ü�5‹zÐÜ
Ð-¬d°5«k×.BÑ.BÐ-CÐCaÐbÓ
cÐcùò `ùó Yùâ4s   Ã:1JÅ9)JÇJ%T)Úfrozenc                  óv   € ] tR t^gt$ RtR]R&   R]R&   R]R&   R]R&   R]R	&   R
]R&   R
]R&   R]R&   R]R&   RtR# )r   a  Record one executed operation of an audit: its parameters, shapes and matrix.

``report.steps`` of an :class:`AugmentationAuditReport` lists one step per executed leaf operation, in execution
order. ``name`` is the qualified module name in the pipeline, ``module`` the class name, and ``occurrence`` counts
repeated runs of one ``name`` from 0. ``params`` and ``flags`` are detached copies; ``flags`` include the keyword
overrides of that image call. ``input_shape`` and ``output_shape`` are those of the image.

``matrix`` is the ``(B, 3, 3)`` map from this operation's input pixel coordinates to its output coordinates,
including ``RandomCrop`` prepadding. ``None`` means the operation has no supported 2D matrix, not that it is an
identity, and ``unsupported_reason`` then says why.

Convention:
    See :ref:`augmentation-audit`.

See Also:
    - :class:`AugmentationAuditReport`: holds the steps and the matrix composed over all of them.
    - :class:`SpatialAudit`: the label statistics, measured with the composed matrix.
rH   r7   rN   Ú
occurrenceÚmoduleútuple[int, ...]Úinput_shapeÚoutput_shapeúdict[str, Any]ÚparamsÚflagsúTensor | NoneÚmatrixz
str | NoneÚunsupported_reasonr'   N©rQ   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r'   r+   r)   r   r   g   s<   ‡ ñð& ƒIØƒOØƒKØ Ó Ø!Ó!ØÓØÓØÓØ"×"r+   c                  óŠ   € ] tR t^‡t$ RtR]R&   R]R&   R]R&   R]R	&   R]R
&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   RtR# )r   að  Hold the per-sample out-of-frame counts and round-trip errors of one keypoint or box input.

``report.spatial`` of an :class:`AugmentationAuditReport` has one entry per keypoint or box input, and each of its
tensor fields is ``(B,)``, one value per sample. ``out_of_frame_fraction`` divides by the total item count, so an
empty input has a NaN fraction. The round-trip statistics cover only finite errors, in pixels; a sample with no
finite error has NaN statistics and a zero ``roundtrip_valid_count``.

Convention:
    See :ref:`augmentation-audit`.

See Also:
    - :class:`AugmentationAuditReport`: holds these entries with the composed matrix they invert.
    - :class:`AugmentationAuditStep`: the per-operation record, without label statistics.

rN   Úinput_indexrH   Údata_keyz(Literal['euclidean', 'corner_hausdorff']Úmetricr   ÚcountÚout_of_frameÚ	nonfiniteÚout_of_frame_fractionÚroundtrip_valid_countÚroundtrip_meanÚroundtrip_medianÚroundtrip_maxr'   Nr`   r'   r+   r)   r   r   ‡   sI   ‡ ñð  ÓØƒMØ4Ó4ØƒMØÓØÓØ!Ó!Ø!Ó!ØÓØÓØ×r+   c                  óØ   € ] tR t^¦t$ RtR]R&   R]R&   R]R&   R]R	&   R
]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   RtR]R&   R R ltR^/R  R! lltR" R# lt	R$t
R%# )&r   a
  Hold the executed operations, composed matrix and label diagnostics of one audit call.

``outputs, report = audit(sequence, image, ...)`` returns it. ``report.summary()`` describes it in text,
``report.to_dict()`` and ``report.to_json()`` export it, and ``sequence(image, ..., params=report.params)``
replays the call. ``matrix`` is the ``(B, 3, 3)`` map from input to output pixel coordinates composed over
``steps``, or ``None`` when ``geometry_status`` is ``"unsupported"``, and ``spatial`` holds one
:class:`SpatialAudit` per keypoint or box input.

``params`` is a detached snapshot of native ``ParamItem`` values. JSON is a diagnostic export, not a
parameter deserializer. Reports retain neither image pixels nor autograd
graphs. Tensor fields are independent snapshots, not read-only tensors.

``geometry_status`` is ``unsupported`` when any executed operation lacks a
supported matrix, ``singular`` when any composed matrix cannot be inverted,
or ``available``. Inspect the per-batch ``invertible`` mask and spatial
errors rather than interpreting availability as alignment success.
``inverse_matrix`` has NaNs for singular/nonfinite batches. No image inverse
is evaluated: coordinate invertibility does not imply pixel reconstruction,
particularly after cropping, interpolation or intensity changes.

Convention:
    See :ref:`augmentation-audit`.

See Also:
    - :func:`audit`: runs a pipeline and builds this report.
    - :class:`AugmentationAuditStep`: one entry of ``steps``.
    - :class:`SpatialAudit`: one entry of ``spatial``.
zlist[dict[str, Any]]ÚinputsrW   rY   úlist[AugmentationAuditStep]Ústepsúlist[ParamItem]r[   zdict[DataKey, dict[str, Any]]Úconfigured_extra_argsz/Literal['available', 'unsupported', 'singular']Úgeometry_statusr]   r^   Úinverse_matrixr   Ú
invertiblezlist[SpatialAudit]Úspatialú	list[str]ÚwarningsrJ   Úroundtrip_toleranceÚout_of_frame_toleranceFrM   Úimage_reconstruction_evaluatedc               ó   € V ^8„  d   QhRR/# )r$   r&   rZ   r'   )r(   s   "r)   r*   Ú$AugmentationAuditReport.__annotate__Ô   s   € ÷ 7ñ 7˜ñ 7r+   c                óV   € \        \        \        \        3,          \	        V 4      4      # )zZExport JSON-safe metadata; tensor values include dtype/device/shape, and NaNs become None.)r   r9   rH   r	   rE   ©Úselfs   &r)   Úto_dictÚAugmentationAuditReport.to_dictÔ   s   € ä”Dœœc˜•N¤K°Ó$5Ó6Ð6r+   Úindentc               ó    € V ^8„  d   QhRRRR/# )r$   r‰   z
int | Noner&   rH   r'   )r(   s   "r)   r*   rƒ   Ø   s   € ÷ Jñ J ð J°Cñ Jr+   c               óP   € \         P                  ! V P                  4       VRR7      # )zNSerialize the report as strict JSON (nonfinite diagnostic values become null).F)r‰   Ú	allow_nan)ÚjsonÚdumpsr‡   )r†   r‰   s   &$r)   Úto_jsonÚAugmentationAuditReport.to_jsonØ   s   € ä�zŠz˜$Ÿ,™,›.°À5ÔIÐIr+   c               ó   € V ^8„  d   QhRR/# )r$   r&   rH   r'   )r(   s   "r)   r*   rƒ   Ü   s   € ÷ 
ñ 
˜ñ 
r+   c                óü   € R\        V P                  4       RV P                   R\        V P                  4       R2V P                  '       d)   RRP                  V P                  4      ,           ,           # R,           # )zZDescribe matrix availability and diagnostic warnings without claiming image invertibility.zAugmentation audit: z captured operations, geometry z, z4 spatial inputs. Image reconstruction not evaluated.Ú
Ú )Úlenrv   ry   r|   r~   Újoinr…   s   &r)   ÚsummaryÚAugmentationAuditReport.summaryÜ   sx   € ð #¤3 t§z¡z£?Ð"3Ð3RÐSW×SgÑSgÐRhÐhjÜ�4—<‘<Ó Ð!Ð!UðWà26·-·-°-ˆt�d—i‘i §¡Ó.Õ.õIð	
ð FHõIð	
r+   r'   N)rQ   ra   rb   rc   rd   re   r�   r‡   r�   r—   rf   r'   r+   r)   r   r   ¦   s   ‡ ñð: !Ó Ø!Ó!Ø&Ó&ØÓØ8Ó8ØDÓDØÓØ!Ó!ØÓØÓØÓØÓØ!Ó!Ø+0Ð" DÓ0õ7ðJ¨a÷ J÷
ñ 
r+   c               ó    € V ^8„  d   QhRRRR/# )r$   rV   ú	nn.Moduler&   rM   r'   )r(   s   "r)   r*   r*   å   s   € ÷ Eñ E 	ð E¨dñ Er+   c                ó6   € ^ RI Hp \        V 4      \        V39   # )é    r   )Ú%kornia.augmentation.container.augmentr   r=   r   )rV   r   s   & r)   Ú_supported_sequencerž   å   s   € ÝLä�‹<œOÐ-CÐDÑDÐDr+   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r$   Úsequencer   ÚprefixrH   Úseenzset[int] | Noner&   zlist[tuple[str, nn.Module]]r'   )r(   s   "r)   r*   r*   ë   s)   € ÷ ñ �oð ¨sð ¸ð ÐZuñ r+   c           	     óü  € Vf   \        4       MTp. pV P                  P                  4        FË  w  rEVf   K  V'       d   V RV 2MTp\        V4      V9   d   \	        R4      hVP                  \        V4      4       \        V\        \        \        34      '       d   \	        R4      h\        V4      '       d,   VP                  \        \        \        V4      Wb4      4       K¹  VP                  We34       KÍ  	  V# )NÚ.z@audit does not support a module registered under multiple names.zHaudit supports 2D image pipelines, not video, patch or 3D augmentations.)ÚsetÚ_modulesr:   ÚidÚ
ValueErrorÚaddr4   r   r   r   rž   ÚextendÚ_leavesr   r   Úappend)r    r¡   r¢   Úresultr7   rV   Úpaths   &&&    r)   r«   r«   ë   sÎ   € Ø’LŒ3Œ5 d€DØ*,€FØ ×)Ñ)×/Ñ/Ö1‰ˆØŠ>Ùß%+�&�˜˜4˜&Ñ!°ˆÜˆf‹:˜ÔÜÐ_Ó`Ð`Ø�‰”�F“ÔÜ�fœ´ÔASÐT×UÒUÜÐgÓhÐhÜ˜v×&Ò&Ø�M‰Mœ'¤$¤¸Ó"?ÀÓLÖMà�M‰M˜4˜.Ö)ñ 2ð €Mr+   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r$   r    r   r[   rw   r¡   rH   r&   r}   r'   )r(   s   "r)   r*   r*   þ   s*   € ÷ 
ñ 
˜oð 
°ð 
ÐPSð 
Ð]fñ 
r+   c           	     óŒ  € . pV F»  pV P                  VP                  4      pV'       d   V R VP                   2MVP                  p\        V4      '       dW   \        VP                  \
        4      '       d7   VP                  \        \        \        V4      VP                  V4      4       Kª  VP                  V4       K½  	  V# )r¤   )Úget_submoduler7   rž   r4   r8   r<   rª   Ú_selected_pathsr   r   r¬   )r    r[   r¡   ÚpathsÚparamrV   r®   s   &&&    r)   r²   r²   þ   s�   € Ø€EÛˆØ×'Ñ'¨¯
©
Ó3ˆß+1�&�˜˜5Ÿ:™:˜,Ñ'°u·z±zˆÜ˜v×&Ò&¬:°e·j±jÄ$×+GÒ+Gà�L‰Lœ¬¬o¸vÓ)FÈÏ
É
ÐTXÓYÖZà�L‰L˜Öñ ð €Lr+   c               ó$   € V ^8„  d   QhRRRRRR/# )r$   r    r   rv   ru   r&   r}   r'   )r(   s   "r)   r*   r*     s$   € ÷ ñ Ð 6ð Ð?Zð Ð_hñ r+   c                óÒ   € \        V 4      '       d   V P                  f   R.# \        W P                  4      pV Uu. uF  q3P                  NK  	  ppW$8w  d   RV RV R2.# . # u upi )Nz`Forward capture cannot be verified for a custom container or a call without recorded parameters.z8Forward capture is incomplete or out of order: selected z; captured r¤   )rž   Ú_paramsr²   r7   )r    rv   ÚselectedÚstepÚcaptureds   &&   r)   Ú_capture_warningsr»     ss   € Ü˜x×(Ò(¨H×,<Ñ,<Ò,DØrÐsÐsÜ˜x×)9Ñ)9Ó:€HÙ&+Ó,¡e˜d—	”	¡e€HÐ,ØÔØJÈ8È*ÐT_Ð`hÐ_iÐijÐkÐlÐlØ€Iùò -s   ¼A$c               ó$   € V ^8„  d   QhRRRRRR/# )r$   r%   r   r>   r   r&   r   r'   )r(   s   "r)   r*   r*     s!   € ÷ ñ ˜ð  wð °6ñ r+   c                óê  € \        V \        4      '       d   V\        9  g,   \        V \        4      '       d!   V\        P
                  8w  d   \        R 4      h\        V \        \        34      '       d&   V P                  e   \        R4      hV P                  # \        V \        4      '       g   \        R4      hV\        9   d/   \        P                  ! V \        V,          RR7      P                  # V # )z8audit Boxes/Keypoints objects must match their data key.zHaudit does not support ragged Boxes or Keypoints constructed from lists.zRaudit requires batched tensors, Boxes or Keypoints; ragged inputs are unsupported.F)ÚmodeÚvalidate_boxes)r4   r   Ú
_BOX_MODESr   r   Ú	KEYPOINTSr¨   Ú_Nr8   r   Úfrom_tensor)r%   r>   s   &&r)   Ú_coordinatesrÄ     s³   € Ü�5œ%× Ò  S´
Ô%:Ü�5œ)×$Ò$¨´×0AÑ0AÔ)AäÐSÓTÐTÜ�%œ%¤Ð+×,Ò,Ø�8‰8ÒÜÐgÓhÐhØ�z‰zÐÜ�eœV×$Ò$ÜÐmÓnÐnØ
ŒjÔä× Ò  ¬Z¸­_ÈUÔS×XÑXÐXØ€Lr+   c               ó4   € V ^8„  d   QhRRRRRRRRR	R
RRRR/# )r$   rV   rš   rt   ztuple[Any, ...]ÚkwargsrZ   Úoutputr	   r7   rH   rv   ru   r&   ÚNoner'   )r(   s   "r)   r*   r*   &  sN   € ÷ +ñ +Øð+àð+ð ð+ð ð	+ð ð+ð 'ð+ð 
ñ+r+   c               óŽ  a€ V^ ,          p\        \        V R/ 4      4      p\        / \        V R/ 4      CVP                  4        UU	u/ uF  w  r‰VR8w  g   K  W‰bK  	  up	pC4      p
RpRp\        V \        \
        34      '       dO   \        V P                  4      pVe+   VP                  VP                  ^ ,          ^^38w  d   RpRpMˆVf   Vf   RpM}\        V 4      \        P                  J d_   \        P                  ! ^VP                  VP                  R7      P                  VP                  ^ ,          R
R
4      P!                  4       pMRpVP#                  \%        S\'        V3R	 lV 4       4      \        V 4      P(                  \+        VP                  4      \+        VP                  4      VV
VV4	      4       R# u up	pi )rœ   r·   r\   r[   Nz5operation produced a matrix with an unsupported shapez%operation did not produce a 2D matrix©rD   rC   zVnon-rigid or unknown operation; coordinate propagation is not certified by a 2D matrixc              3  ó@   <"  € T F  qP                   S8H  x € K  	  R # 5ir.   )r7   )r0   r¹   r7   s   & €r)   r2   Ú_capture.<locals>.<genexpr>H  s   øé € Ð4©e d—	‘	˜TÖ!«eùs   ƒéÿÿÿÿ)r/   rI   r:   r4   r   r   Útransform_matrixrB   r=   r   ÚIdentityrO   ÚeyerD   rC   Úexpandr6   r¬   r   ÚsumrQ   r;   )rV   rt   rÆ   rÇ   r7   rv   Úimager[   r>   r%   r\   r^   Úreasons   &&&&d$       r)   Ú_capturerÕ   &  s€  ø€ ð �1�I€EÜ”w˜v y°"Ó5Ó6€Fô ØlŒ7�6˜7 BÓ'ÐlÈÏÉÌÔ+kÉ¹:¸3Ð[^ÐbjÑ[j¬J¨CªJÉÒ+kÐló€Eð €FØ€FÜ�&Ô6Ô8SÐT×UÒUô ˜6×2Ñ2Ó3ˆØÒ &§,¡,°5·;±;¸qµ>À1ÀaÐ2HÔ"HØˆFØL‰FØŠ^ ¢Ø<ˆFøÜ	ˆf‹œŸ™Ó	$Ü—’˜1 U§\¡\¸¿¹ÔE×LÑLÈUÏ[É[ÐYZÍ^Ð]_ÐacÓd×jÑjÓl‰àiˆØ	‡L�LÜØÜÔ4©eÓ4Ó4Ü�‹L×!Ñ!Ü�%—+‘+ÓÜ�&—,‘,ÓØØØØó
	
öùó# ,ls   ÁGÁGc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r$   rv   ru   rÓ   r   Úcapture_completerM   r&   z+tuple[Tensor | None, Tensor | None, Tensor]r'   )r(   s   "r)   r*   r*   T  s0   € ÷ "ñ "Ø&ð"àð"ð ð	"ð
 1ñ"r+   c          
     óª  € V'       gF   R R \         P                  ! VP                  ^ ,          VP                  \         P                  R7      3# VP
                  \         P                  8X  d   \         P                  M\         P                  p\         P                  ! ^VP                  VR7      P                  VP                  ^ ,          RR4      pVP                  4       pV  FŸ  pVP                  e&   VP                  P                  VP                  8w  dH   R R \         P                  ! VP                  ^ ,          VP                  \         P                  R7      3u # VP                  P                  V4      V,          pK¡  	  VP                  4       P                  RR7      p\         P                  P!                  \         P"                  ! VR,          WT4      4      w  r‰Wy^ 8H  ,          VP                  4       P                  RR7      ,          p
\         P"                  ! V
R,          V\         P$                  ! V\'        R4      4      4      pWXV
3# )NrÊ   ©ÚdimÚnanrÍ   )éþÿÿÿrÍ   ):NNNNN)rO   ÚzerosrB   rD   rM   rC   Úfloat64Úfloat32rÐ   rÑ   r6   r^   ÚtorL   ÚallÚlinalgÚinv_exÚwhereÚ	full_likerJ   )rv   rÓ   r×   rC   Úidentityr^   r¹   ÚfiniteÚinverseÚinfoÚvalids   &&$        r)   Ú	_matricesrë   T  s™  € ÷ Ø�Tœ5Ÿ;š; u§{¡{°1¥~¸e¿l¹lÔRW×R\ÑR\Ô]Ð]Ð]Ø"Ÿ[™[¬E¯M©MÔ9ŒE�MŠM¼u¿}¹}€EÜ�yŠy˜ 5§<¡<°uÔ=×DÑDÀUÇ[Á[ÐQRÅ^ÐUWÐY[Ó\€HØ�^‰^Ó€FÛˆØ�;‰;Ò $§+¡+×"3Ñ"3°v·|±|Ô"CØ˜œuŸ{š{¨5¯;©;°q­>À%Ç,Á,ÔV[×V`ÑV`ÔaÐaÒaØ—‘—‘ Ó'¨&Õ0Šñ ð �_‰_Ó×"Ñ" xÐ"Ó0€FÜ—L‘L×'Ñ'¬¯ª°F¸=Õ4IÈ6Ó(\Ó]�M€GØ˜a‘iÕ  7×#3Ñ#3Ó#5×#9Ñ#9¸hÐ#9Ó#GÕG€EÜ�kŠk˜% Õ.°¼¿ºÈÔRWÐX]ÓR^Ó9_Ó`€GØ˜EÐ!Ð!r+   c               ó8   € V ^8„  d   QhRRRRRRRRRR	R
RRRRR/# )r$   Úsourcer   r­   r>   r   ÚindexrN   rB   rW   rè   r]   rC   ztorch.dtyper&   r   r'   )r(   s   "r)   r*   r*   j  sX   € ÷ 9ñ 9Øð9àð9ð 
ð9ð ð	9ð
 ð9ð ð9ð ð9ð ñ9r+   c                ó  € V P                   VP                   8w  d   \        R 4      hV P                  VR7      VP                  4       P                  VR7      rVP                   R,          w  rxVP	                  4       P                  ^4      P                  R4      p	VR,          ^ 8  VR,          VR,          ^,
          8„  ,          VR,          ^ 8  ,          VR,          VR,          ^,
          8„  ,          p
V\        9   d   V
P                  R4      p
\        P                  ! V3W�P                  \        P                  R7      p\        P                  ! Wx3\        R4      VP                  VR7      pVEe+   V'       Ed"   VP                  VR^4      p\        P                  ! V\        P                   ! VR,          4      3RR7      VP#                  RR4      ,          pVR,          VR,          ,          P%                  V4      pV\        9   dk   \        P&                  ! Wð4      p\        P(                  ! VP+                  R4      P-                  R4      VP+                  R4      P-                  R4      4      pM'\        P.                  P1                  Wð,
          RR7      pVP	                  4       p\        P2                  ! VV\        P4                  ! V\        R4      4      4      pVP7                  R4      pVP9                  R4      V,          pV'       dy   VP;                  RRR7      pVP=                  \        R4      ) R7      P-                  R4      p\        P2                  ! V^ 8„  V\        P4                  ! V\        R4      4      4      pM VP?                  4       VP?                  4       ppW©,          P7                  R4      p\A        TVPB                  V\        9   d   R	MR
VVV	( P7                  R4      VV,          VVVV4      # )zRaudit requires spatial outputs to preserve the source shape and label cardinality.)rC   ºNr$   NrÊ   rÛ   rÙ   g      à?Úinf)rÛ   Úcorner_hausdorffÚ	euclideanrÍ   ).rœ   ).é   rÜ   ).:Nrô   N).rð   ).:r$   NN)"rB   r¨   rà   r5   rL   Úflattenrá   rÀ   ÚanyrO   ÚfullrD   ÚlongrJ   ÚreshapeÚcatÚ	ones_likeÚ	transposeÚ
reshape_asÚcdistÚmaximumÚaminÚamaxrâ   Úvector_normrä   rå   rÒ   ÚnansumÚnanquantileÚ
nan_to_numr6   r   r7   )rí   r­   r>   rî   rB   rè   rC   Úbatchrk   rç   ÚoutsideÚcountsÚerrorsÚflatÚhomogeneousÚrestoredÚ	distancesrê   Úvalid_countÚmeanÚmedianrÿ   rl   s   &&&&&&&                r)   Ú_spatial_auditr  j  s"  € ð ‡|�|�v—|‘|Ô#ÜÐmÓnÐnØ—Y‘Y U�YÓ+¨V¯]©]«_×-?Ñ-?ÀeÐ-?Ó-LˆFØ—<‘< Õ#�L€EØ�_‰_Ó×&Ñ& qÓ)×-Ñ-¨bÓ1€Fà	��˜!Ñ	Ø�&�>˜E "�I¨�MÑ)õ	+à�&�>˜AÑõ	ð �&�>˜E "�I¨�MÑ)õ	+ð ð ŒjÔØ—+‘+˜b“/ˆÜ�ZŠZ˜˜ %·±ÄUÇZÁZÔP€FÜ�ZŠZ˜˜¬¨e«¸V¿]¹]ÐRWÔX€FØÓŸu˜uØ�~‰~˜e R¨Ó+ˆÜ—i’i ¤u§¢°t¸Gµ}Ó'EÐ FÈBÔOÐRY×RcÑRcÐdfÐhjÓRkÕkˆà Õ(¨;°wÕ+?Õ?×KÑKÈFÓSˆØ”*ÔÜŸš HÓ5ˆIÜ—]’] 9§>¡>°"Ó#5×#:Ñ#:¸2Ó#>À	ÇÁÈrÓ@R×@WÑ@WÐXZÓ@[Ó\‰Fä—\‘\×-Ñ-¨hÕ.?ÀRÐ-ÓHˆFØ�O‰OÓ€EÜ�[Š[˜ ¬¯ª¸ÄÀeÃÓ(MÓN€FØ—)‘)˜B“-€KØ�=‰=˜Ó˜{Õ*€DßØ×#Ñ# C¨RÐ#Ó0ˆØ×#Ñ#¬¨u«¨Ð#Ó6×;Ñ;¸BÓ?ˆÜ—+’+˜k¨A™o¨w¼¿ºÈÔQVÐW\ÓQ]Ó8^Ó_‰àŸ*™*›,¨¯
©
«�ˆØÕ$×)Ñ)¨"Ó-€LÜØØ�‰Ø!¤ZÔ/Ñ°[ØØØ
ˆ�‰�bÓØ�vÕØØØØóð r+   r[   Ú	data_keysr   gü©ñÒMbP?r€   g        c               ó4   € V ^8„  d   QhRRRRRRRRR	R
RR
RR/# )r$   r    r   Úargsr   r[   zlist[ParamItem] | Noner  z list[str | int | DataKey] | Noner   rJ   r€   r&   zOtuple[DataType | list[DataType] | dict[str, DataType], AugmentationAuditReport]r'   )r(   s   "r)   r*   r*   ¦  sX   € ÷ `ñ `Ø$ð`àð`ð #ð`ð 0ð	`ð
 ð`ð "ð`ð Uñ`r+   c               ó   € \         P                  ! V4      '       d   V^ 8  d   \        R4      h\         P                  ! V4      '       d   ^ Tu;8:  d   ^8:  g   M \        R4      hVf   V P                  MTpVf   \        R4      hV Uu. uF  p\        P
                  ! V4      NK  	  pp\        V4      \        V4      8w  gI   V'       dA   V^ ,          \        P                  8w  g%   VP                  \        P                  4      ^8w  d   \        R4      hV^ ,          p	\        V	\        4      '       d*   V	P                  ^8w  g   V	P                  ^ ,          ^ 8X  d   \        R4      h\        V 4      p
/ p. p\        \        WX4      4       EFª  w  pw  rçV\        P                  \        P                   \        P"                  .\$        O59  d   \        RVP&                   R24      h\)        Wç4      pV\        P"                  8X  d   R&MV\        P                   8X  d   R'MR(pVP                  V9  gE   VP                  ^ ,          V	P                  ^ ,          8w  g   VP*                  V	P*                  8w  d   \        R	4      h\        V\,        \.        34      '       d   VP0                  M\3        \        V4      pVP5                  R
VP&                  R\7        VP                  4      RVP8                  RVP*                  /4       V\        P"                  8X  g   V\$        9   g   EK�  \;        V4      W½&   EK­  	  . pV
 UUu. uF)  w  ppVP=                  \?        \@        VVR7      RR7      NK+  	  ppp V ! VRVRV/ pV F  pVPC                  4        K  	  \        V\D        4      '       d   TMV.pV^ ,          p\        V\        4      '       d;   VP                  ^8w  g*   VP                  ^ ,          V	P                  ^ ,          8w  d   \        R4      h\7        VP                  4      p\F        PH                  ! 4       ;_uu_ 4        \F        PJ                  ! V	P*                  PL                  RR7      ;_uu_ 4        \O        V V4      p\Q        VV	V'       * R7      w  pppVf   RM"\S        VPU                  4       4      '       d   RMRpV	P8                  \F        PV                  8X  d   \F        PV                  M\F        PX                  p VP[                  4        UU!u. uF4  w  pp!\]        V!\)        VV,          W�,          4      W�,          VVVV 4      NK6  	  p"pp!TV U#u. uF3  p#V#P^                  '       g   K  V#P&                   RV#P^                   R2NK5  	  up#,           p$VR8X  d   V$P5                  R4       V F¶  p#RV#P`                  9   g…   \b        ;QJ d@    R \        V#Pd                  R)R V#Pf                  R)R 4       4       F  '       g   K   RM5	  RM1! R \        V#Pd                  R)R V#Pf                  R)R 4       4       4      '       g   K˜  V$P5                  V#P&                   R24       K¸  	  V" EFI  p%\S        V%Ph                  ^ 8„  Pc                  4       4      '       d    V$P5                  RV%Pj                   R 24       \S        V%Pl                  V8„  Pc                  4       4      '       d$   V$P5                  RV%Pj                   R!VR" R24       VeV   \S        V%Pn                  V%P                  8  Pc                  4       4      '       d    V$P5                  RV%Pj                   R#24       \S        V%Pp                  V8„  Pc                  4       4      '       g   EK&  V$P5                  RV%Pj                   R$VR" R%24       EKL  	  \s        TTT\;        V Pt                  ;'       g    . 4      \;        V Pv                  4      VVVVV"V$VV4      p&RRR4       RRR4       VX&3# u upi u uppi   T F  pTPC                  4        K  	  i ; iu up!pi u up#i   + '       g   i     LP; i  + '       g   i     TX&3# ; i)*a[	  Run an augmentation pipeline once and return its outputs with a geometry audit report.

``outputs, report = audit(sequence, image, *labels)`` runs ``sequence`` once on a nonempty ``(B, C, H, W)`` image
followed by optional batched masks (``(B, C, H, W)`` or ``(B, H, W)``), keypoints or boxes, in the order of
``data_keys``. ``outputs`` has the structure, values and gradients of an ordinary forward call, and ``report`` is
an :class:`AugmentationAuditReport` of the executed operations, their composed matrix and the round-trip errors
of every keypoint and box input. ``params`` and ``data_keys`` have the meaning they have in
:meth:`~kornia.augmentation.container.AugmentationSequential.forward`.

Unknown or non-rigid operations run normally and make the composed geometry unsupported. Keypoints and boxes through
``RandomElasticTransform``, ``RandomThinPlateSpline`` or ``RandomFisheye`` raise ``NotImplementedError``, as in
the sequence (`#4420 <https://github.com/kornia/kornia/issues/4420>`_). The audit runs eagerly; do not audit the
same stateful sequence concurrently.

Convention:
    :ref:`augmentation-audit` states the direction of ``report.matrix``, the pixel-centre rectangle of the
    out-of-frame test, the dtypes of the diagnostics and the inputs it accepts.

Args:
    sequence: The 2D augmentation sequence to execute and inspect.
    args: Image and optional spatial inputs accepted by the sequence.
    params: Optional sampled parameters to replay.
    data_keys: Optional positional data-key override.
    roundtrip_tolerance: Nonnegative pixel threshold for round-trip warnings.
    out_of_frame_tolerance: Fraction in ``[0, 1]`` above which an input gets a warning.

Returns:
    A pair ``(outputs, report)``.

Raises:
    ValueError: if a tolerance is out of range, ``data_keys`` do not start with the only image or do not match
        the inputs, a data key is unsupported, the image is not a nonempty ``(B, C, H, W)`` tensor, or a label
        input is unbatched, ragged or on another device; if the pipeline holds a video, patch or 3D
        augmentation or a module registered under two names, or an operation changes the batch, the layout or
        the label cardinality.

See Also:
    - :meth:`~kornia.augmentation.container.AugmentationSequential.forward`: the same call without a report.
    - :class:`AugmentationAuditReport`: the report this returns.
z3roundtrip_tolerance must be finite and nonnegative.z4out_of_frame_tolerance must be between zero and one.NzQaudit requires explicit positional data_keys when the pipeline data_keys is None.zKaudit requires exactly one image as the first input and matching data_keys.z_audit requires a nonempty BCHW image tensor; dictionaries and unbatched inputs are unsupported.z$audit does not support the data key r¤   zNaudit inputs must be batched with the same batch size and device as the image.ri   rB   rC   rD   )r7   rv   T)Úwith_kwargsr[   r  zPaudit requires operations to preserve the image batch dimension and BCHW layout.F)Údevice_typeÚenabled)r×   ÚunsupportedÚ	availableÚsingularz: zNSome composed matrices are singular or nonfinite; inspect the invertible mask.ÚCropc              3  ó.   "  € T F  w  rW!8  x € K  	  R # 5ir.   r'   )r0   ÚbeforeÚafters   &  r)   r2   Úaudit.<locals>.<genexpr>%  s   é € ð ,Ù4f¡= 6�–Ó4fùs   ‚zZ: cropping or downsampling may discard image content even when coordinates are invertible.zInput z: nonfinite output coordinates.z : out-of-frame fraction exceeds Úgz=: some round-trip errors are nonfinite; inspect valid counts.z: round-trip error exceeds z pixels.)é   )r"  é   )r#  rÜ   )<rK   rL   r¨   r  r   Úgetr•   ÚINPUTrk   r4   r   ÚndimrB   r«   Ú	enumerateÚzipÚMASKrÁ   rÀ   r7   rÄ   rD   r   r   r8   r   r¬   r;   rC   r/   Úregister_forward_hookr   rÕ   Úremover<   rO   Úno_gradÚautocastr=   r»   rë   rM   rá   rÞ   rß   r:   r  r_   rV   rö   rX   rY   rm   rh   rn   ro   rr   r   r·   Ú
extra_args)'r    r[   r  r   r€   r  Úselected_keysr>   ÚkeysrÓ   ÚleavesÚsourcesÚmetadatarî   r%   ÚtensorÚexpected_ndimsÚoriginalrv   r7   rV   ÚhandlesÚoutputsÚhandlerA   Úoutput_imagerY   Úcapture_warningsr^   rè   rê   ÚstatusÚdiagnostic_dtyperí   r|   r¹   r~   r1   Úreports'   &$$$$*                                 r)   Úauditr?  ¦  s   € ô` �=Š=Ð,×-Ò-Ð1DÀqÔ1HÜÐNÓOÐOÜ�=Š=Ð/×0Ò0¸Ð=SÖ8XÐWXÖ8XÜÐOÓPÐPØ*3Ò*;�H×&Ò&À€MØÒÜÐlÓmÐmÙ(5Ó6© ŒG�KŠK˜Ö©€DÐ6Ü
ˆ4ƒy”C˜“IÔ§T¨T°!­W¼¿¹Ô-EÈÏÉÔT[×TaÑTaÓIbÐfgÔIgÜÐfÓgÐgØ��G€EÜ�eœV×$Ò$¨¯
©
°a¬¸5¿;¹;Àq½>ÈQÔ;NÜØmó
ð 	
ô �XÓ€FØ!#€GØ€HÜ(¬¨T«×9Ñˆ‰|�Ø”w—}‘}¤g§l¡l´G×4EÑ4EÐSÌ
ÑSÔSÜÐCÀCÇHÁHÀ:ÈQÐOÓPÐPÜ˜eÓ)ˆà!$¬×(9Ñ(9Ô!9™ÈÔPW×P\ÑP\ÔI\¹vÐbfˆØ�;‰;˜nÔ,°·±¸QµÀ5Ç;Á;ÈqÅ>Ô0QÐU[×UbÑUbÐfk×frÑfrÔUrÜÐmÓnÐnÜ!+¨E´E¼9Ð3E×!FÒ!F�5—:’:ÌDÔQWÐY^ÓL_ˆØ�‰à˜CŸH™HØœ˜xŸ~™~Ó.Ø˜Ÿ™Ø˜(Ÿ/™/ð	ô	
ð ”'×#Ñ#Ô# s¬j×'8Ü& vÓ.ˆGŒNñ%  :ð& *,€Eñ #ôá"‰LˆD�&ð 	×$Ñ$¤W¬X¸DÈÔ%NÐ\`Ð$ÖaÙ"ð ñ ðÙ˜DÐ@¨Ð@¸4Ñ@ˆãˆFØ�M‰MŽOñ ä" 7¬D×1Ò1‰W¸°y€FØ˜!•9€LÜ�l¤F×+Ò+¨|×/@Ñ/@ÀAÔ/EÈ×I[ÑI[Ð\]ÕI^Ðbg×bmÑbmÐnoÕbpÔIpÜÐkÓlÐlÜ˜×+Ñ+Ó,€Lô 
�Š��œ%Ÿ.š.°U·\±\×5FÑ5FÐPU×VÖVÜ,¨X°uÓ=ÐÜ!*¨5°%ÐN^ÔJ^Ô!_Ñˆ�˜à#š^‰MÄÀUÇYÁYÃ[×@QÒ@Q±ÐWað 	ð -2¯K©K¼5¿=¹=Ô,Hœ5Ÿ=š=ÌeÏmÉmÐð ")§¡¤ô
ñ "1‘��vô ØÜ˜V E�]¨D­KÓ8Ø•ØØØØ öñ "1ð 	ñ 
ð $ÙCHó'
ÙCH¸4ÈD×LcÕLcÔ6ˆt�y‰yˆk˜˜D×3Ñ3Ð4°AÓ6Á5ñ'
õ 
ˆð �ZÔØ�O‰OÐlÔmÛˆDØ˜Ÿ™Ô$¯«ñ ,Ü47¸×8HÑ8HÈÈÐ8MÈt×O`ÑO`ÐacÐadÐOeÔ4fó,¯¯ªñ ,Ü47¸×8HÑ8HÈÈÐ8MÈt×O`ÑO`ÐacÐadÐOeÔ4fó,÷ )ô )ð —‘Ø—y‘y�kð "<ð <öñ	 ô ˆDÜ�T—^‘^ aÑ'×,Ñ,Ó.×/Ò/Ø—‘ &¨×)9Ñ)9Ð(:Ð:YÐ ZÔ[Ü�T×/Ñ/Ð2HÑH×MÑMÓO×PÒPØ—‘ &¨×)9Ñ)9Ð(:Ð:ZÐ[qÐrsÐZtÐtuÐ vÔwØÒ"¤t¨T×-GÑ-GÈ$Ï*É*Ñ-T×,YÑ,YÓ,[×'\Ò'\Ø—‘Ø˜T×-Ñ-Ð.Ð.kÐlôô �T×'Ñ'Ð*=Ñ=×BÑBÓD×EÕEØ—‘ &¨×)9Ñ)9Ð(:Ð:UÐViÐjkÐUlÐltÐ u×vñ ô )ØØØÜ�h×&Ñ&×,Ð,¨"Ó-Ü�h×)Ñ)Ó*ØØØØØØØØ"ó
ˆ÷W W�ðt �Fˆ?ÐùòS 7ùó>øó ˆFØ�M‰MŽOò üó 
ùò'
÷' W×Vú�Žðt �Fˆ?Ðús‚   Â`#Í/`(Í8
`. Ñ5a*ÒBa	Ô :aÕa	Õ"aÕ; aÖAa	×5a	Ø<a	ÙEa	Þ Aa	ß('a	àa*à.a	áa	áa'á"a*á*a=	)r   r   r   r?  )r”   N)r”   )Brd   Ú
__future__r   r�   rK   Údataclassesr   r   r   Úenumr   Ú	functoolsr   Útypingr   r	   r
   r   r   rO   r   r   Ú&kornia.augmentation._2d.geometric.baser   Ú&kornia.augmentation._2d.intensity.baser   Úkornia.augmentation._3d.baser   Ú#kornia.augmentation.container.imager   Ú!kornia.augmentation.container.opsr   Ú$kornia.augmentation.container.paramsr   Ú#kornia.augmentation.container.patchr   Ú#kornia.augmentation.container.videor   Úkornia.constantsr   Úkornia.geometry.boxesr   Úkornia.geometry.keypointsr   r�   r   Ú__all__r   ÚBBOXÚ	BBOX_XYXYÚ	BBOX_XYWHrÀ   r/   rE   r   r   r   rž   r«   r²   r»   rÄ   rÕ   rë   r  r?  r'   r+   r)   Ú<module>rT     sN  ðñ$õ #ã Û ß 7Ñ 7Ý Ý ß =Õ =ã ß å NÝ NÝ ;Ý ?Ý 6Ý :Ý ?Ý ?Ý $Ý 'Ý /çÝLâ
W€áˆTƒ]€Ø�l‰l˜O¨W×->Ñ->ÀÈW×M^ÑM^Ð`fÐg€
õ	õdñ6 �$Ô÷#ð #ó ð#ñ> �$Ô÷ð ó ðñ< �$Ô÷;
ð ;
ó ð;
õ|E÷÷&
õõõ"+õ\"õ,9ðx`ð &*ð`ð 37ð	`ð
 "&ð`ð %(÷`ñ `r+   