+
     °³j÷…  ã                   ó˜  € ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RIHt ^ RIH	t
Ht ^RIHt R R ltR R	 ltR
 tR tR tR t]P*                  P,                  R 4       tR tR tR tR tR t]P*                  P:                  R 4       tR tR t R t!]P*                  P,                  R 4       t"RR lt# ! R R]PH                  4      t%R# )é    )ÚOptionalN)Únn)ÚboxesÚ	roi_align)Ú_utilsc                ó  € V ^8„  d   QhR\         P                  R\         P                  R\        \         P                  ,          R\        \         P                  ,          R\        \         P                  \         P                  3,          /# )é   Úclass_logitsÚbox_regressionÚlabelsÚregression_targetsÚreturn)ÚtorchÚTensorÚlistÚtuple)Úformats   "Úg/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/models/detection/roi_heads.pyÚ__annotate__r      sf   € ÷ ))ñ ))Ü—,‘,ð))ä—L‘Lð))ô ”—‘Õð))ô œUŸ\™\Õ*ð	))ô
 Œ5�<‰<œŸ™Ð%Õ&ñ))ó    c                óÌ  € \         P                  ! V^ R7      p\         P                  ! V^ R7      p\        P                  ! W4      p\         P                  ! V^ 8„  4      ^ ,          pW%,          pV P
                  w  rxVP                  WqP                  R4      ^,          ^4      p\        P                  ! WV3,          W5,          RRR7      p	W’P                  4       ,          p	WI3# )zÞ
Computes the loss for Faster R-CNN.

Args:
    class_logits (Tensor)
    box_regression (Tensor)
    labels (list[BoxList])
    regression_targets (Tensor)

Returns:
    classification_loss (Tensor)
    box_loss (Tensor)
©ÚdimÚsum)ÚbetaÚ	reductionéÿÿÿÿgÇqÇq¼?)
r   ÚcatÚFÚcross_entropyÚwhereÚshapeÚreshapeÚsizeÚsmooth_l1_lossÚnumel)
r
   r   r   r   Úclassification_lossÚsampled_pos_inds_subsetÚ
labels_posÚNÚnum_classesÚbox_losss
   &&&&      r   Úfastrcnn_lossr-      sÆ   € ô( �YŠY�v 1Ô%€FÜŸšÐ#5¸1Ô=ÐäŸ/š/¨,Ó?Ðô
 $Ÿkšk¨&°1©*Ó5°aÕ8ÐØÕ0€JØ!×'Ñ'�N€AØ#×+Ñ+¨A×/BÑ/BÀ2Ó/FÈ!Õ/KÈQÓO€Nä×ÒØ°
Ð:Õ;ØÕ3ØØô	€Hð Ÿ,™,›.Õ(€HàÐ(Ð(r   c                ó¤   € V ^8„  d   QhR\         P                  R\        \         P                  ,          R\        \         P                  ,          /# )r	   Úxr   r   )r   r   r   )r   s   "r   r   r   8   s7   € ÷ ñ œ%Ÿ,™,ð ´´U·\±\Õ0Bð ÄtÌEÏLÉLÕGYñ r   c                óN  € V P                  4       pV P                  ^ ,          pV Uu. uF  qDP                  ^ ,          NK  	  pp\        P                  ! V4      p\        P                  ! W1P
                  R7      pW&V3,          R,          pVP                  V^ R7      pV# u upi )aÜ  
From the results of the CNN, post process the masks
by taking the mask corresponding to the class with max
probability (which are of fixed size and directly output
by the CNN) and return the masks in the mask field of the BoxList.

Args:
    x (Tensor): the mask logits
    labels (list[BoxList]): bounding boxes that are used as
        reference, one for each image

Returns:
    results (list[BoxList]): one BoxList for each image, containing
        the extra field mask
©Údevicer   ©ºNNNN)Úsigmoidr"   r   r   Úaranger2   Úsplit)r/   r   Ú	mask_probÚ	num_masksÚlabelÚboxes_per_imageÚindexs   &&     r   Úmaskrcnn_inferencer=   8   sˆ   € ð  —	‘	“€Ið —‘˜•
€IÙ39Ó:±6¨%—{‘{ 1—~�~±6€OÐ:Ü�YŠY�vÓ€FÜ�LŠL˜¯=©=Ô9€EØ ˜-Õ(¨Õ1€IØ—‘ °Q�Ó7€IàÐùò ;s   ¨B"c                óÀ   € VP                  V4      p\        P                  ! VR,          V.^R7      pV R,          P                  V4      p \        WW33R4      R,          # )a  
Given segmentation masks and the bounding boxes corresponding
to the location of the masks in the image, this function
crops and resizes the masks in the position defined by the
boxes. This prepares the masks for them to be fed to the
loss computation as the targets.
r   g      ð?r3   ©r4   r   )Útor   r   r   )Úgt_masksr   Úmatched_idxsÚMÚroiss   &&&& r   Úproject_masks_on_boxesrE   U   sW   € ð  —?‘? 5Ó)€LÜ�9Š9�l 7Õ+¨UÐ3¸Ô;€DØ˜Õ ×#Ñ# DÓ)€HÜ�X a V¨SÓ1°$Õ7Ð7r   c                ó@  € V P                   R,          p\        W44       UUu. uF  w  rgWg,          NK  	  ppp\        W!V4       U	U
Uu. uF  w  ršp\        WšWµ4      NK  	  pp
p	p\        P                  ! V^ R7      p\        P                  ! V^ R7      pVP                  4       ^ 8X  d   V P                  4       ^ ,          # \        P                  ! V \        P                  ! VP                   ^ ,          VP                  R7      V3,          V4      pV# u uppi u upp
p	i )z�
Args:
    proposals (list[BoxList])
    mask_logits (Tensor)
    targets (list[BoxList])

Return:
    mask_loss (Tensor): scalar tensor containing the loss
r   r1   r   )r"   ÚziprE   r   r   r&   r   r   Ú binary_cross_entropy_with_logitsr6   r2   )Úmask_logitsÚ	proposalsrA   Ú	gt_labelsÚmask_matched_idxsÚdiscretization_sizeÚgt_labelÚidxsr   ÚmÚpÚiÚmask_targetsÚ	mask_losss   &&&&&         r   Úmaskrcnn_lossrU   d   sù   € ð &×+Ñ+¨BÕ/ÐÜ36°yÔ3TÔUÑ3T¡ ˆh�nˆnÑ3T€FÑUäLOÐPXÐevÔLwõÙLwÁÀÀqÔ˜q QÖ<ÑLwð ò ô �YŠY�v 1Ô%€FÜ—9’9˜\¨qÔ1€Lð ×ÑÓ˜qÔ Ø�‰Ó  1Õ$Ð$ä×2Ò2Ø”E—L’L §¡¨a¥¸¿¹ÔGÈÐOÕPÐR^ó€Ið Ðùó! Vùôs   ¢DÁDc                 óè  € VR,          pVR,          pW!R,          VR,          ,
          ,          pW!R,          VR,          ,
          ,          pVR,          pVR,          pVR,          pVR,          pV R,          pV R,          pWqR,          R,          8H  p	W�R,          R,          8H  p
Ws,
          V,          pVP                  4       P                  4       pW„,
          V,          pVP                  4       P                  4       pV^,
          Wy&   V^,
          WŠ&   V^ 8¬  V^ 8¬  ,          Wr8  ,          W‚8  ,          pV R,          ^ 8„  pW¼,          P                  4       pW‚,          V,           pWí,          pWý3# )	r4   r?   ©r4   é   ©r4   r	   ©r4   é   r3   ).r   ).rX   ).r	   )ÚfloorÚlong)Ú	keypointsrD   Úheatmap_sizeÚoffset_xÚoffset_yÚscale_xÚscale_yr/   ÚyÚx_boundary_indsÚy_boundary_indsÚ	valid_locÚvisÚvalidÚlin_indÚheatmapss   &&&             r   Úkeypoints_to_heatmaprl   „   sO  € à�D�z€HØ�D�z€HØ 4�j¨4°­:Õ5Õ6€GØ 4�j¨4°­:Õ5Õ6€Gà˜Õ €HØ˜Õ €HØ�gÕ€GØ�gÕ€Gà�&Õ€AØ�&Õ€Aà �: gÕ.Ñ.€OØ �: gÕ.Ñ.€Oà	
�˜Õ €AØ	�‰‹	�‰Ó€AØ	
�˜Õ €AØ	�‰‹	�‰Ó€Aà%¨Õ)€AÑØ%¨Õ)€AÑà�a‘˜A ™FÕ# qÑ'7Õ8¸AÑ<LÕM€IØ
�FÕ
˜aÑ
€CØ�_×"Ñ"Ó$€EàÕ Õ"€GØ�€Hàˆ?Ðr   c                 óh  € \         P                  ! V P                  ^4      \         P                  R7      pWB,          p	WS,          p
\        P
                  ! VR,          \        V4      \        V4      3RRR7      R,          p\         P                  ! VP                  ^4      \         P                  R7      pVP                  VR	4      P                  ^R7      pWÜ,          pWÞ,
          V,          p\         P                  ! R\         P                  R7      VP                  \         P                  R7      ,           V	P                  \         P                  R7      ,          p\         P                  ! R\         P                  R7      VP                  \         P                  R7      ,           V
P                  \         P                  R7      ,          pVVP                  \         P                  R7      ,           pVVP                  \         P                  R7      ,           p\         P                  ! VP                  \         P                  R7      p\         P                  ! VP                  \         P                  R7      VP                  \         P                  R7      VP                  \         P                  R7      .^ 4      pWˆ,          V,           ^,           p\         P                  ! V4      pVP                  \         P                  R7      V,          pVP!                  ^VP                  \         P                  R7      4      P!                  ^VP                  \         P                  R7      4      P#                  R	4      P!                  ^ VP                  \         P                  R7      4      pVV3# )
rX   ©ÚdtypeÚbicubicF©r$   ÚmodeÚalign_cornersr   ç      à?r3   r?   r   )r   Úscalar_tensorr$   Úint64r   ÚinterpolateÚintr#   ÚargmaxÚtensorÚfloat32r@   Úonesr"   Ústackr6   Úindex_selectÚview)ÚmapsÚmaps_iÚroi_map_widthÚroi_map_heightÚwidths_iÚ	heights_iÚ
offset_x_iÚ
offset_y_iÚnum_keypointsÚwidth_correctionÚheight_correctionÚroi_mapÚwÚposÚx_intÚy_intr/   rd   Úxy_preds_i_0Úxy_preds_i_1Úxy_preds_i_2Ú
xy_preds_iÚbaseÚindÚend_scores_is   &&&&&&&&                 r   Ú_onnx_heatmaps_to_keypointsr—   ¨   s•  € ô ×'Ò'¨¯	©	°!«¼E¿K¹KÔH€MàÕ/ÐØ!Õ2Ðä�mŠmØˆw�œs >Ó2´C¸Ó4FÐGÈiÐglôà
õ€Gô 	×Ò˜GŸL™L¨›O´5·;±;Ô?€AØ
�/‰/˜-¨Ó
,×
3Ñ
3¸Ð
3Ó
:€Cà�G€EØ�[˜QÕ€Eä	�Š�c¤§¡Ô	/°%·(±(ÄÇÁ°(Ó2OÕ	OÐSc×SfÑSfÜ�m‰mð Tgó Tõ 	€Aô 
�Š�c¤§¡Ô	/°%·(±(ÄÇÁ°(Ó2OÕ	OÐSd×SgÑSgÜ�m‰mð Thó Tõ 	€Að �z—}‘}¬5¯=©=�}Ó9Õ9€LØ�z—}‘}¬5¯=©=�}Ó9Õ9€LÜ—:’:˜l×0Ñ0¼¿¹ÔF€LÜ—’à�O‰O¤%§-¡-ˆOÓ0Ø�O‰O¤%§-¡-ˆOÓ0Ø�O‰O¤%§-¡-ˆOÓ0ð	
ð
 	
ó€Jð Õ(¨=Õ8¸1Õ<€DÜ
�,Š,�}Ó
%€CØ
�&‰&”u—{‘{ˆ&Ó
# dÕ
*€Cà×Ñ˜Q §¡¬u¯{©{ Ó ;Ó<ß	‰�a˜Ÿ™¬¯©˜Ó4Ó	5ß	‰ˆb‹ß	‰�a˜Ÿ™¤e§k¡k˜Ó2Ó	3ð	 ð �|Ð#Ð#r   c	                 ó^  € \         P                  ! ^ ^\        V4      3\         P                  V P                  R7      p	\         P                  ! ^ \        V4      3\         P                  V P                  R7      p
\        \        VP                  ^ 4      4      4       EF
  p\        W V,          W+,          W;,          WK,          W[,          Wk,          W{,          4      w  rÍ\         P                  ! V	P                  \         P                  R7      VP                  ^ 4      P                  \         P                  R7      3^ 4      p	\         P                  ! V
P                  \         P                  R7      VP                  \         P                  R7      P                  ^ 4      3^ 4      p
EK  	  Wš3# )r   ©ro   r2   rn   )r   Úzerosrx   r{   r2   Úranger$   r—   r   r@   Ú	unsqueeze)r€   rD   Úwidths_ceilÚheights_ceilÚwidthsÚheightsr`   ra   rˆ   Úxy_predsÚ
end_scoresrR   r“   r–   s   &&&&&&&&&     r   Ú _onnx_heatmaps_to_keypoints_loopr£   Û   s6  € ô �{Š{˜A˜q¤# mÓ"4Ð5¼U¿]¹]ÐSW×S^ÑS^Ô_€HÜ—’˜a¤ ]Ó!3Ð4¼E¿M¹MÐRV×R]ÑR]Ô^€Jä”3�t—y‘y “|Ó$×%ˆÜ#>Ø�q•'˜;�>¨<­?¸F½IÀwÅzÐS[ÕS^Ð`hÕ`kó$
Ñ ˆ
ô —9’9˜hŸk™k´·±˜kÓ>À
×@TÑ@TÐUVÓ@W×@ZÑ@ZÔaf×anÑanÐ@ZÓ@oÐpÐrsÓtˆÜ—Y’YØ�]‰]¤§¡ˆ]Ó/°·±ÄuÇ}Á}°Ó1U×1_Ñ1_Ð`aÓ1bÐcÐefó
‹
ñ &ð ÐÐr   c                ó`  € VR,          pVR,          pVR,          VR,          ,
          pVR,          VR,          ,
          pVP                  ^R7      pVP                  ^R7      pVP                  4       pVP                  4       pV P                  ^,          p\        P                  ! 4       '       dO   \        V VVVVVVV\        P                  ! V\        P                  R7      4	      w  ršV	P                  ^ ^^4      V
3# \        P                  ! \        V4      ^V3\        P                  V P                  R7      p	\        P                  ! \        V4      V3\        P                  V P                  R7      p
\        \        V4      4       EFˆ  p\        Wk,          P!                  4       4      p\        W{,          P!                  4       4      pWK,          V,          pW[,          V,          p\"        P$                  ! W,          R,          WÜ3RRR7      R,          pVP                  ^,          pVP'                  VR4      P)                  ^R7      pVV,          p\        P*                  ! VV,
          VR	R
7      pVP-                  4       R,           V,          pVP-                  4       R,           V,          pVW+,          ,           W›^ R3&   VW;,          ,           W›^R3&   ^W›^R3&   V\        P.                  ! VVP                  R7      VV3,          W«R3&   EK‹  	  V	P                  ^ ^^4      V
3# )ab  Extract predicted keypoint locations from heatmaps.

Args:
    maps (Tensor[K, N, H, W]): The predicted heatmaps, where K is the number of RoIs,
        N is the number of keypoints, and H, W are the heatmap spatial dimensions.
    rois (Tensor[K, 4]): The RoI boxes in ``(x1, y1, x2, y2)`` format.

Returns:
    tuple:
        - **xy_preds** (Tensor[K, N, 3]): The predicted keypoint locations, where the last
          dimension contains ``(x, y, v)`` with x, y being coordinates and v being visibility (always 1).
        - **scores** (Tensor[K, N]): The heatmap scores at the predicted keypoint locations.
r4   ©Úminrn   r™   rp   Frq   r   r\   )Úrounding_modert   r1   r?   rW   rY   rZ   r3   r   )ÚclampÚceilr"   ÚtorchvisionÚ_is_tracingr£   r   ru   rv   Úpermuterš   Úlenr{   r2   r›   rx   Úitemr   rw   r#   ry   ÚdivÚfloatr6   )r€   rD   r`   ra   rŸ   r    r�   rž   rˆ   r¡   r¢   rR   r‚   rƒ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r/   rd   s   &&                     r   Úheatmaps_to_keypointsr±   í   s¦  € ð& �D�z€HØ�D�z€Hà�$�Z˜$˜t�*Õ$€FØ�4�j˜4 �:Õ%€GØ�\‰\˜aˆ\Ó €FØ�m‰m ˆmÓ"€GØ—+‘+“-€KØ—<‘<“>€Là—J‘J˜q•M€Mä×Ò× Ò Ü?ØØØØØØØØÜ×Ò ´U·[±[ÔAó
 
Ñˆð ×Ñ  1 aÓ(¨*Ð4Ð4ä�{Š{œC ›I q¨-Ð8ÄÇÁÐVZ×VaÑVaÔb€HÜ—’œc $›i¨Ð7¼u¿}¹}ÐUY×U`ÑU`Ôa€JÜ”3�t“9×ˆÜ˜K�N×/Ñ/Ó1Ó2ˆÜ˜\�_×1Ñ1Ó3Ó4ˆØ!�9 }Õ4ÐØ#�J¨Õ7ÐÜ—-’-Ø�G�GÕ NÐ#BÈÐbgô
à
õˆð �M‰M˜!ÕˆØ�o‰o˜m¨RÓ0×7Ñ7¸AÐ7Ó>ˆà�a•ˆÜ—	’	˜# �+ q¸Ô@ˆð �[‰[‹]˜SÕ Ð$4Õ4ˆØ�[‰[‹]˜SÕ Ð$5Õ5ˆØ ¥�Oˆ�A�q�ÑØ ¥�Oˆ�A�q�ÑØˆ�A�q�ÑØ"¤5§<¢<°ÀgÇnÁnÔ#UÐW\Ð^cÐ#cÕdˆ
�a�4Ôñ+ ð. ×Ñ˜A˜q !Ó$ jÐ0Ð0r   c                 ó
  € V P                   w  rErgWg8w  d   \        R V RV 24      hTp. p	. p
\        WV4       F]  w  r¼pWÍ,          p\        WëV4      w  ppV	P	                  VP                  R4      4       V
P	                  VP                  R4      4       K_  	  \        P                  ! V	^ R7      p\        P                  ! V
^ R7      P                  \        P                  R7      p
\        P                  ! V
4      ^ ,          p
VP                  4       ^ 8X  g   \        V
4      ^ 8X  d   V P                  4       ^ ,          # V P                  WE,          Wg,          4      p \        P                  ! W
,          VV
,          4      pV# )z_keypoint_logits height and width (last two elements of shape) should be equal. Instead got H = z	 and W = r   rn   r   )r"   Ú
ValueErrorrG   rl   Úappendr   r   r   r@   Úuint8r!   r&   r­   r   r   r    )Úkeypoint_logitsrJ   Úgt_keypointsÚkeypoint_matched_idxsr*   ÚKÚHÚWrM   rk   ri   Úproposals_per_imageÚgt_kp_in_imageÚmidxÚkpÚheatmaps_per_imageÚvalid_per_imageÚkeypoint_targetsÚkeypoint_losss   &&&&               r   Úkeypointrcnn_lossrÄ   6  s[  € à ×&Ñ&�J€Aˆ!Ø„vÜØmÐnoÐmpÐpyÐz{Ðy|Ð}ó
ð 	
ð ÐØ€HØ€EÜ58¸ÐRgÖ5hÑ1Ð¨TØÕ!ˆÜ.BÀ2Ð\oÓ.pÑ+Ð˜OØ�‰Ð*×/Ñ/°Ó3Ô4Ø�‰�_×)Ñ)¨"Ó-Ö.ñ	 6iô —y’y ¨qÔ1ÐÜ�IŠI�e Ô#×&Ñ&¬U¯[©[Ð&Ó9€EÜ�KŠK˜Ó˜qÕ!€Eð ×ÑÓ 1Ô$¬¨E«
°a¬Ø×"Ñ"Ó$ qÕ(Ð(à%×*Ñ*¨1­5°!µ%Ó8€Oä—O’O OÕ$:Ð<LÈUÕ<SÓT€MØÐr   c                 ó  € . p. pV Uu. uF  qDP                  ^ 4      NK  	  ppV P                  V^ R7      p\        Wa4       F4  w  rx\        Wx4      w  ršVP	                  V	4       VP	                  V
4       K6  	  W#3# u upi )r   r   )r$   r7   rG   r±   r´   )r/   r   Úkp_probsÚ	kp_scoresÚboxr;   Úx2ÚxxÚbbÚkp_probÚscoress   &&         r   Úkeypointrcnn_inferencerÎ   U  s~   € à€HØ€Iá.3Ó4©e s—x‘x –{©e€OÐ4Ø	
�‰� aˆÓ	(€Bä�b–.‰ˆÜ/°Ó7‰ˆØ�‰˜Ô Ø×Ñ˜Ö ñ !ð
 ÐÐùò 5s   ‰A=c                 ó  € V R,          V R,          ,
          R,          pV R,          V R,          ,
          R,          pV R,          V R,          ,           R,          pV R,          V R,          ,           R,          pVP                  \        P                  R7      V,          pVP                  \        P                  R7      V,          pWB,
          pWS,
          pWB,           pWS,           p	\        P                  ! WgW‰3^4      p
V
# )r4   rt   rn   rY   r?   rZ   rW   )r@   r   r{   r}   )r   ÚscaleÚw_halfÚh_halfÚx_cÚy_cÚ
boxes_exp0Ú
boxes_exp1Ú
boxes_exp2Ú
boxes_exp3Ú	boxes_exps   &&         r   Ú_onnx_expand_boxesrÚ   e  sÇ   € à�D�k˜E $�KÕ'¨3Õ.€FØ�D�k˜E $�KÕ'¨3Õ.€FØ��;˜˜t�Õ$¨Õ
+€CØ��;˜˜t�Õ$¨Õ
+€Cà�Y‰YœUŸ]™]ˆYÓ+¨eÕ3€FØ�Y‰YœUŸ]™]ˆYÓ+¨eÕ3€Fà•€JØ•€JØ•€JØ•€JÜ—’˜Z°ZÐLÈaÓP€IØÐr   c                 óæ  € \         P                  ! 4       '       d   \        W4      # V R,          V R,          ,
          R,          pV R,          V R,          ,
          R,          pV R,          V R,          ,           R,          pV R,          V R,          ,           R,          pW!,          pW1,          p\        P                  ! V 4      pWB,
          VR&   WB,           VR&   WS,
          VR&   WS,           VR&   V# )r4   rt   rY   r?   rZ   rW   )rª   r«   rÚ   r   Ú
zeros_like)r   rÐ   rÑ   rÒ   rÓ   rÔ   rÙ   s   &&     r   Úexpand_boxesrÝ   z  sÈ   € ä×Ò× Ò Ü! %Ó/Ð/Ø�D�k˜E $�KÕ'¨3Õ.€FØ�D�k˜E $�KÕ'¨3Õ.€FØ��;˜˜t�Õ$¨Õ
+€CØ��;˜˜t�Õ$¨Õ
+€Cà
…O€FØ
…O€Fä× Ò  Ó'€IØ•l€Iˆd�OØ•l€Iˆd�OØ•l€Iˆd�OØ•l€Iˆd�OØÐr   c                 óô   € \         P                  ! V ^V,          ,           4      P                  \         P                  4      \         P                  ! V 4      P                  \         P                  4      ,          # )r	   )r   rz   r@   r{   )rC   Úpaddings   &&r   Úexpand_masks_tracing_scalerà   Ž  sI   € ô �<Š<˜˜A �K�Ó(×+Ñ+¬E¯M©MÓ:¼U¿\º\È!»_×=OÑ=OÔPU×P]ÑP]Ó=^Õ^Ð^r   c                 ó
  € V P                   R,          p\        P                  P                  4       '       d   \	        W!4      pM \        V^V,          ,           4      V,          p\        P                  ! W3^,          4      pWC3# )rX   r   )r"   r   Ú_CÚ_get_tracing_staterà   r°   r   Úpad)Úmaskrß   rC   rÐ   Úpadded_masks   &&   r   Úexpand_masksrç   ”  s`   € à�
‰
�2�€AÜ‡x�x×"Ñ"×$Ò$Ü*¨1Ó6‰ä�a˜!˜g�+•oÓ&¨Õ*ˆÜ—%’%˜˜j¨1�nÓ-€KØÐÐr   c                 óò  € ^p\        V^,          V^ ,          ,
          V,           4      p\        V^,          V^,          ,
          V,           4      p\        V^4      p\        V^4      pV P                  R4      p \        P                  ! WV3RRR7      p V ^ ,          ^ ,          p \
        P                  ! W#3V P                  V P                  R7      p\        V^ ,          ^ 4      p\        V^,          ^,           V4      p	\        V^,          ^ 4      p
\        V^,          ^,           V4      pW
V^,          ,
          W±^,          ,
          1W�^ ,          ,
          W‘^ ,          ,
          13,          WzV1W‰13&   V# )rX   ÚbilinearFrq   r™   )rX   rX   r   r   )
rx   ÚmaxÚexpandr   rw   r   rš   ro   r2   r¦   )rå   rÈ   Úim_hÚim_wÚ	TO_REMOVErŒ   ÚhÚim_maskÚx_0Úx_1Úy_0Úy_1s   &&&&        r   Úpaste_mask_in_imagerõ   Ÿ  s3  € à€IÜˆC��F�S˜•V�O˜iÕ'Ó(€AÜˆC��F�S˜•V�O˜iÕ'Ó(€AÜˆAˆq‹	€AÜˆAˆq‹	€Að �;‰;�~Ó&€Dô �=Š=˜¨ F°È5ÔQ€DØ��7�1�:€Dä�kŠk˜4˜,¨d¯j©jÀÇÁÔM€GÜ
ˆc�!�f�a‹.€CÜ
ˆc�!�f�q�j˜$Ó
€CÜ
ˆc�!�f�a‹.€CÜ
ˆc�!�f�q�j˜$Ó
€Cà $¨C°­F¥l°sÀ½Vµ|Ð%DÀsÐQRÍVÅ|ÐX[ÐbcÕ^dÕXdÐFeÐ%eÕ f€G�ˆG�S�WÐÑØ€Nr   c                 ó¦  € \         P                  ! ^\         P                  R7      p\         P                  ! ^\         P                  R7      pV^,          V^ ,          ,
          V,           pV^,          V^,          ,
          V,           p\         P                  ! \         P
                  ! Wd34      4      p\         P                  ! \         P
                  ! Wt34      4      pV P                  ^^V P                  ^ 4      V P                  ^4      34      p \        P                  ! V \        V4      \        V4      3RRR7      p V ^ ,          ^ ,          p \         P                  ! \         P
                  ! V^ ,          P                  ^ 4      V34      4      p\         P                  ! \         P
                  ! V^,          P                  ^ 4      V,           VP                  ^ 4      34      4      p	\         P                  ! \         P
                  ! V^,          P                  ^ 4      V34      4      p
\         P                  ! \         P
                  ! V^,          P                  ^ 4      V,           VP                  ^ 4      34      4      pW
V^,          ,
          W±^,          ,
          1W�^ ,          ,
          W‘^ ,          ,
          13,          p\         P                  ! W¬P                  ^4      4      p\         P                  ! W+,
          VP                  ^4      4      p\         P
                  ! WÜP                  \         P                  R7      V3^ 4      ^ V1R3,          p\         P                  ! VP                  ^ 4      V4      p\         P                  ! VP                  ^ 4      W9,
          4      p\         P
                  ! VVV3^4      RRV13,          pV# )rX   rn   ré   Frq   r4   N)r   r|   rv   rš   rê   r   rë   r$   r   rw   rx   rœ   r¦   r@   r{   )rå   rÈ   rì   rí   ÚoneÚzerorŒ   rï   rñ   rò   ró   rô   Úunpaded_im_maskÚzeros_y0Úzeros_y1Úconcat_0Úzeros_x0Úzeros_x1rð   s   &&&&               r   Ú_onnx_paste_mask_in_imagerÿ   ¸  s¬  € Ü
�*Š*�QœeŸk™kÔ
*€CÜ�;Š;�q¤§¡Ô,€DàˆA���Q•�˜#Õ€AØˆA���Q•�˜#Õ€AÜ�	Š	”%—)’)˜Q˜HÓ%Ó&€AÜ�	Š	”%—)’)˜Q˜HÓ%Ó&€Að �;‰;˜˜1˜dŸi™i¨›l¨D¯I©I°a«LÐ9Ó:€Dô �=Š=˜¤S¨£V¬S°«VÐ$4¸:ÐUZÔ[€DØ��7�1�:€Dä
�)Š)”E—I’I˜s 1�v×/Ñ/°Ó2°DÐ9Ó:Ó
;€CÜ
�)Š)”E—I’I˜s 1�v×/Ñ/°Ó2°SÕ8¸$¿.¹.ÈÓ:KÐLÓMÓ
N€CÜ
�)Š)”E—I’I˜s 1�v×/Ñ/°Ó2°DÐ9Ó:Ó
;€CÜ
�)Š)”E—I’I˜s 1�v×/Ñ/°Ó2°SÕ8¸$¿.¹.ÈÓ:KÐLÓMÓ
N€Cà # a¥&�L¨S°qµ6­\Ð:¸SÀqÅ6½\ÈcÐXYÕTZÍlÐ<[Ð[Õ\€Oô
 �{Š{˜3× 4Ñ 4°QÓ 7Ó8€HÜ�{Š{˜4�: ×';Ñ';¸AÓ'>Ó?€HÜ�yŠy˜(×$6Ñ$6¼U¿]¹]Ð$6Ó$KÈXÐVÐXYÓZÐ[\Ð]aÐ[aÐcdÐ[dÕe€Hä�{Š{˜8Ÿ=™=¨Ó+¨SÓ1€HÜ�{Š{˜8Ÿ=™=¨Ó+¨T­ZÓ8€HÜ�iŠi˜ 8¨XÐ6¸Ó:¸1¸e¸t¸e¸8ÕD€GØ€Nr   c                 ó  € \         P                  ! ^ W#4      p\        V P                  ^ 4      4       FK  p\	        W,          ^ ,          W,          W#4      pVP                  ^ 4      p\         P                  ! WF34      pKM  	  V# ©r   )r   rš   r›   r$   rÿ   rœ   r   )Úmasksr   rì   rí   Ú
res_appendrR   Úmask_ress   &&&&   r   Ú_onnx_paste_masks_in_image_loopr  Ü  sh   € ä—’˜Q Ó+€JÜ�5—:‘:˜a“=Ö!ˆÜ,¨U­X°a­[¸%½(ÀDÓOˆØ×%Ñ% aÓ(ˆÜ—Y’Y 
Ð5Ó6Š
ñ "ð Ðr   c           
      ó`  € \        WR 7      w  r\        W4      P                  \        P                  R7      pVw  rV\
        P                  ! 4       '       d]   \        W\        P                  ! V\        P                  R7      \        P                  ! V\        P                  R7      4      R,          # \        W4       UUu. uF  w  rx\        V^ ,          W…V4      NK  	  p	pp\        V	4      ^ 8”  d"   \        P                  ! V	^ R7      R,          p
V
# V P                  ^ ^WV34      p
V
# u uppi ))rß   rn   r   r3   )rç   rÝ   r@   r   rv   rª   r«   r  ru   rG   rõ   r­   r}   Ú	new_empty)r  r   Ú	img_shaperß   rÐ   rì   rí   rP   ÚbÚresÚrets   &&&&       r   Úpaste_masks_in_imager  æ  sú   € ä Ô7�L€EÜ˜Ó&×)Ñ)´·±Ð)Ó<€EØ�J€Dä×Ò× Ò Ü.Øœ%×-Ò-¨d¼%¿+¹+ÔFÌ×H[ÒH[Ð\`Ôhm×hsÑhsÔHtó
à
õð 	ô ADÀEÔ@QÔ
RÑ@Q¹¸Ô˜q �t Q¨dÖ3Ñ@Q€CÑ
RÜ
ˆ3ƒx�!„|Ü�kŠk˜# 1Ô% gÕ.ˆð €Jð �o‰o˜q ! TÐ0Ó1ˆØ€Jùó Ss   ÃD*c                   óÈ   a a€ ] tR tRt oR]P
                  R]P                  R]P                  /tRV 3R llt	R t
R tR tR	 tR
 tR tR tR tRV3R lR lltRtVtV ;t# )ÚRoIHeadsiø  Ú	box_coderÚproposal_matcherÚfg_bg_samplerc                ó”  <€ \         SV `  4        \        P                  V n        \
        P                  ! WER R7      V n        \
        P                  ! Wg4      V n	        Vf   Rp\
        P                  ! V4      V n        Wn        W n        W0n        W�n        W n        W°n        WÀn        WÐn        Wàn        Wðn        VV n        VV n        R# )F)Úallow_low_quality_matchesN)ç      $@r  ç      @r  )ÚsuperÚ__init__Úbox_opsÚbox_iouÚbox_similarityÚ	det_utilsÚMatcherr  ÚBalancedPositiveNegativeSamplerr  ÚBoxCoderr  Úbox_roi_poolÚbox_headÚbox_predictorÚscore_threshÚ
nms_threshÚdetections_per_imgÚmask_roi_poolÚ	mask_headÚmask_predictorÚkeypoint_roi_poolÚkeypoint_headÚkeypoint_predictor)Úselfr  r   r!  Úfg_iou_threshÚbg_iou_threshÚbatch_size_per_imageÚpositive_fractionÚbbox_reg_weightsr"  r#  r$  r%  r&  r'  r(  r)  r*  Ú	__class__s   &&&&&&&&&&&&&&&&&&€r   r  ÚRoIHeads.__init__ÿ  s®   ø€ ô. 	‰ÑÔä%Ÿo™oˆÔä )× 1Ò 1°-ÐjoÔ pˆÔä&×FÒFÐG[ÓoˆÔàÒ#Ø5ÐÜ"×+Ò+Ð,<Ó=ˆŒà(ÔØ ŒØ*Ôà(ÔØ$ŒØ"4Ôà*ÔØ"ŒØ,Ôà!2ÔØ*ˆÔØ"4ˆÖr   c                óf   € V P                   f   R# V P                  f   R# V P                  f   R# R# ©NFT)r%  r&  r'  ©r+  s   &r   Úhas_maskÚRoIHeads.has_mask2  s0   € Ø×ÑÒ%ÙØ�>‰>Ò!ÙØ×ÑÒ&ÙÙr   c                óf   € V P                   f   R# V P                  f   R# V P                  f   R# R# r4  )r(  r)  r*  r5  s   &r   Úhas_keypointÚRoIHeads.has_keypoint;  s2   € Ø×!Ñ!Ò)ÙØ×ÑÒ%ÙØ×"Ñ"Ò*ÙÙr   c                óÞ  € . p. p\        WV4       EFV  w  rgpVP                  4       ^ 8X  d€   VP                  p	\        P                  ! VP
                  ^ ,          3\        P                  V	R7      p
\        P                  ! VP
                  ^ ,          3\        P                  V	R7      pM™\        P                  ! Wv4      pV P                  V4      pVP                  ^ R7      p
WŠ,          pVP                  \        P                  R7      pWÐP                  P                  8H  p^ W¾&   WÐP                  P                  8H  pRW¿&   VP                  V
4       VP                  V4       EKY  	  WE3# )r   r™   r¥   rn   r   )rG   r&   r2   r   rš   r"   rv   r  r  r  r¨   r@   ÚBELOW_LOW_THRESHOLDÚBETWEEN_THRESHOLDSr´   )r+  rJ   Úgt_boxesrK   rB   r   Úproposals_in_imageÚgt_boxes_in_imageÚgt_labels_in_imager2   Úclamped_matched_idxs_in_imageÚlabels_in_imageÚmatch_quality_matrixÚmatched_idxs_in_imageÚbg_indsÚignore_indss   &&&&            r   Úassign_targets_to_proposalsÚ$RoIHeads.assign_targets_to_proposalsD  sP  € àˆØˆÜILÈYÐbk×IlÑEÐÐ3Eà ×&Ñ&Ó(¨AÔ-à+×2Ñ2�Ü05·²Ø'×-Ñ-¨aÕ0Ð2¼%¿+¹+Èfô1Ð-ô #(§+¢+Ð/A×/GÑ/GÈÕ/JÐ.LÔTY×T_ÑT_ÐhnÔ"o‘ô (/§¢Ð7HÓ']Ð$Ø(,×(=Ñ(=Ð>RÓ(SÐ%à0E×0KÑ0KÐPQÐ0KÓ0RÐ-à"4Õ"S�Ø"1×"4Ñ"4¼5¿;¹;Ð"4Ó"G�ð 0×3HÑ3H×3\Ñ3\Ñ\�Ø+,�Ñ(ð 4×7LÑ7L×7_Ñ7_Ñ_�Ø/1�Ñ,à×ÑÐ =Ô>Ø�M‰M˜/×*ñ9 Jmð: Ð#Ð#r   c                óØ   € V P                  V4      w  r#. p\        \        W#4      4       F<  w  pw  rg\        P                  ! Wg,          4      ^ ,          pVP                  V4       K>  	  V# r  )r  Ú	enumeraterG   r   r!   r´   )	r+  r   Úsampled_pos_indsÚsampled_neg_indsÚsampled_indsÚimg_idxÚpos_inds_imgÚneg_inds_imgÚimg_sampled_indss	   &&       r   Ú	subsampleÚRoIHeads.subsampleg  sg   € à-1×-?Ñ-?ÀÓ-GÑ*ÐØˆÜ5>¼sÐCSÓ?fÖ5gÑ1ˆGÑ1�lÜ$Ÿ{š{¨<Õ+FÓGÈÕJÐØ×ÑÐ 0Ö1ñ 6hð Ðr   c                óx   € \        W4       UUu. uF  w  r4\        P                  ! W434      NK  	  pppV# u uppi ©N)rG   r   r   )r+  rJ   r>  ÚproposalÚgt_boxs   &&&  r   Úadd_gt_proposalsÚRoIHeads.add_gt_proposalsp  s8   € äKNÈyÔKcÔdÑKcÑ7G°x”U—Y’Y Ð1Ö2ÑKcˆ	ÑdàÐùó es   �"6c                óŒ  € Vf   \        R4      h\        V Uu. uF  pRV9   NK
  	  up4      '       g   \        R4      h\        V Uu. uF  pRV9   NK
  	  up4      '       g   \        R4      hV P                  4       '       d2   \        V Uu. uF  pRV9   NK
  	  up4      '       g   \        R4      hR # R # u upi u upi u upi )Nútargets should not be Noner   z0Every element of targets should have a boxes keyr   z1Every element of targets should have a labels keyr  z0Every element of targets should have a masks key)r³   Úallr6  )r+  ÚtargetsÚts   && r   Úcheck_targetsÚRoIHeads.check_targetsv  s³   € àŠ?ÜÐ9Ó:Ð:Ü©'Ó2©' Q�G˜q”L©'Ñ2×3Ò3ÜÐOÓPÐPÜ©7Ó3©7 a�H ”M©7Ñ3×4Ò4ÜÐPÓQÐQØ�=‰=�?Š?Ü©gÓ6©g¨˜ 1œ©gÑ6×7Ò7Ü Ð!SÓTÐTñ 8ñ ùò	 3ùâ3ùò 7s   ™B7ÁB<ÂCc                ó"  € V P                  V4       Vf   \        R4      hV^ ,          P                  pV^ ,          P                  pV Uu. uF  qUR,          P	                  V4      NK  	  ppV Uu. uF  qUR,          NK  	  ppV P                  W4      pV P                  WV4      w  r‰V P                  V	4      p
. p\        V4      p\        V4       F‘  pW­,          pW,          V,          W&   W�,          V,          W�&   W�,          V,          W�&   Wm,          pVP                  4       ^ 8X  d   \        P                  ! RW4R7      pVP                  WøV,          ,          4       K“  	  V P                  P                  W±4      pWV	V3# u upi u upi )Nr\  r   r   r™   )rX   é   )r`  r³   ro   r2   r@   rY  rH  rS  r­   r›   r&   r   rš   r´   r  Úencode)r+  rJ   r^  ro   r2   r_  r>  rK   rB   r   rN  Úmatched_gt_boxesÚ
num_imagesÚimg_idrR  r@  r   s   &&&              r   Úselect_training_samplesÚ RoIHeads.select_training_samples‚  sx  € ð 	×Ñ˜7Ô#ØŠ?ÜÐ9Ó:Ð:Ø˜!•×"Ñ"ˆØ˜1•×$Ñ$ˆá29Ó:±'¨Q�g•J—M‘M %Ö(±'ˆÐ:Ù*1Ó2©' Q�x—[�[©'ˆ	Ð2ð ×)Ñ)¨)Ó>ˆ	ð  $×?Ñ?À	ÐU^Ó_Ñˆà—~‘~ fÓ-ˆØÐÜ˜“^ˆ
Ü˜JÖ'ˆFØ+Õ3ÐØ )Õ 1Ð2BÕ CˆIÑØ#�^Ð,<Õ=ˆF‰NØ#/Õ#7Ð8HÕ#IˆLÑ à (Õ 0ÐØ ×&Ñ&Ó(¨AÔ-Ü$)§K¢K°¸eÔ$SÐ!Ø×#Ñ#Ð$5À6Õ6JÕ$KÖLñ (ð "Ÿ^™^×2Ñ2Ð3CÓOÐØ¨Ð0BÐBÐBùò1 ;ùÚ2s   Á FÁ1Fc                óª  € VP                   pVP                  R,          pV Uu. uF  qwP                  ^ ,          NK  	  ppV P                  P                  W#4      p	\        P
                  ! VR4      p
V	P                  V^ 4      pV
P                  V^ 4      p. p. p. p\        W¼V4       EFž  w  ppp\        P                  ! VV4      p\        P                  ! WeR7      pVP                  ^R4      P                  V4      pVR,          pVR,          pVR,          pVP                  R^4      pVP                  R4      pVP                  R4      p\        P                  ! VV P                   8„  4      ^ ,          pVV,          VV,          VV,          ppp\        P"                  ! VRR7      pVV,          VV,          VV,          ppp\        P$                  ! VVVV P&                  4      pVRV P(                   pVV,          VV,          VV,          pppVP+                  V4       VP+                  V4       VP+                  V4       EK¡  	  WÞV3# u upi )rX   r1   g{®Gáz„?)Úmin_sizeNr   )r4   :rX   NN)r2   r"   r  Údecoder   Úsoftmaxr7   rG   r  Úclip_boxes_to_imager   r6   r   Ú	expand_asr#   r!   r"  Úremove_small_boxesÚbatched_nmsr#  r$  r´   )r+  r
   r   rJ   Úimage_shapesr2   r+   Úboxes_in_imager;   Ú
pred_boxesÚpred_scoresÚpred_boxes_listÚpred_scores_listÚ	all_boxesÚ
all_scoresÚ
all_labelsr   rÍ   Úimage_shaper   ÚindsÚkeeps   &&&&&                 r   Úpostprocess_detectionsÚRoIHeads.postprocess_detections¨  s'  € ð ×$Ñ$ˆØ"×(Ñ(¨Õ,ˆáIRÓSÉ°~×/Ñ/°×2Ð2ÉˆÐSØ—^‘^×*Ñ*¨>ÓEˆ
ä—i’i ¨bÓ1ˆà$×*Ñ*¨?¸AÓ>ˆØ&×,Ñ,¨_¸aÓ@Ðàˆ	Øˆ
Øˆ
Ü*-¨oÐQ]×*^Ñ&ˆE�6˜;Ü×/Ò/°°{ÓCˆEô —\’\ +Ô=ˆFØ—[‘[  BÓ'×1Ñ1°&Ó9ˆFð ˜%•LˆEØ˜E•]ˆFØ˜E•]ˆFð —M‘M " aÓ(ˆEØ—^‘^ BÓ'ˆFØ—^‘^ BÓ'ˆFô —;’;˜v¨×(9Ñ(9Ñ9Ó:¸1Õ=ˆDØ$)¨$¥K°¸µ¸vÀd½|˜6�6ˆEô ×-Ò-¨e¸dÔCˆDØ$)¨$¥K°¸µ¸vÀd½|˜6�6ˆEô ×&Ò& u¨f°f¸d¿o¹oÓNˆDàÐ1˜$×1Ñ1Ð2ˆDØ$)¨$¥K°¸µ¸vÀd½|˜6�6ˆEà×Ñ˜UÔ#Ø×Ñ˜fÔ%Ø×Ñ˜f×%ñC +_ðF  jÐ0Ð0ùò] Ts   ¤Ic                óp  <€ V ^8„  d   QhRS[ S[S[P                  3,          RS[S[P                  ,          RS[S[S[S[3,          ,          RS[S[S[ S[S[P                  3,          ,          ,          RS[S[S[ S[S[P                  3,          ,          S[ S[S[P                  3,          3,          /# )r	   ÚfeaturesrJ   rr  r^  r   )ÚdictÚstrr   r   r   r   rx   r   )r   Ú__classdict__s   "€r   r   ÚRoIHeads.__annotate__ã  s«   ø€ ÷ Tñ Tá‘s™EŸL™LÐ(Õ)ðTñ ™Ÿ™Õ%ðTñ ™5¡¡c �?Õ+ð	Tñ
 ™$™t¡C©¯©Ð$5Õ6Õ7Õ8ðTñ 
‰t‘D™™eŸl™lÐ*Õ+Õ,©d±3¹¿¹Ð3DÕ.EÐEÕ	FñTr   c           
     óè  € VEe   V EF  p\         P                  \         P                  \         P                  3pVR,          P                  V9  d    \        RVR,          P                   24      hVR,          P                  \         P                  8X  g    \        RVR,          P                   24      hV P                  4       '       g   KÇ  VR,          P                  \         P                  8X  d   Kï  \        RVR,          P                   24      h	  V P                  '       d   V P                  W$4      w  r'r‰MRpRp	RpV P                  WV4      p
V P                  V
4      p
V P                  V
4      w  r¼. p/ pV P                  '       d5   Vf   \        R4      hV	f   \        R	4      h\        W¼W‰4      w  ppR
VRV/pM_V P!                  W¼W#4      w  ppp\#        V4      p\%        V4       F/  pVP'                  RVV,          RVV,          RVV,          /4       K1  	  V P)                  4       '       EdÏ   V Uu. uF  pVR,          NK  	  ppV P                  '       d—   Vf   \        R4      h\#        V4      p. p. p\%        V4       Fh  p\         P*                  ! VV,          ^ 8„  4      ^ ,          pVP'                  VV,          V,          4       VP'                  VV,          V,          4       Kj  	  MRpV P,                  e7   V P-                  VVV4      pV P/                  V4      pV P1                  V4      pM\3        R4      h/ pV P                  '       dZ   Ve	   Ve   Vf   \        R4      hV Uu. uF  qUR,          NK  	  ppV Uu. uF  qUR,          NK  	  pp\5        VVVVV4      pRV/pM?V U u. uF  p V R,          NK  	  pp \7        VV4      p!\9        V!V4       F  w  p"p V"V R&   K  	  VP;                  V4       V P<                  Ee¼   V P>                  Ee­   V P@                  Eež   V Uu. uF  pVR,          NK  	  p#pV P                  '       d—   \#        V4      p. p#. pVf   \        R4      h\%        V4       Fh  p\         P*                  ! VV,          ^ 8„  4      ^ ,          pV#P'                  VV,          V,          4       VP'                  VV,          V,          4       Kj  	  MRpV P=                  VV#V4      p$V P?                  V$4      p$V PA                  V$4      p%/ p&V P                  '       d>   Ve   Vf   \        R4      hV Uu. uF  qUR,          NK  	  p'p\C        V%V#V'V4      p(RV(/p&MDV%e   V#f   \        R4      h\E        V%V#4      w  p)p*\9        V)V*V4       F  w  p+p,p V+V R&   V,V R&   K  	  VP;                  V&4       WÞ3# u upi u upi u upi u up i u upi u upi )z„
Args:
    features (List[Tensor])
    proposals (List[Tensor[N, 4]])
    image_shapes (List[Tuple[H, W]])
    targets (List[Dict])
Nr   z-target boxes must of float type, instead got r   z.target labels must of int64 type, instead got r^   z1target keypoints must of float type, instead got zlabels cannot be Nonez!regression_targets cannot be NoneÚloss_classifierÚloss_box_regrÍ   z/if in training, matched_idxs should not be Nonez%Expected mask_roi_pool to be not NonezCtargets, pos_matched_idxs, mask_logits cannot be None when trainingr  Ú	loss_maskz0if in trainning, matched_idxs should not be NonezJboth targets and pos_matched_idxs should not be None when in training modeÚloss_keypointzXboth keypoint_logits and keypoint_proposals should not be None when not in training modeÚkeypoints_scores)#r   r°   ÚdoubleÚhalfro   Ú	TypeErrorrv   r9  r{   Útrainingrh  r  r   r!  r³   r-   r~  r­   r›   r´   r6  r!   r%  r&  r'  Ú	ExceptionrU   r=   rG   Úupdater(  r)  r*  rÄ   rÎ   )-r+  r�  rJ   rr  r^  r_  Úfloating_point_typesrB   r   r   Úbox_featuresr
   r   ÚresultÚlossesr‡  rˆ  r   rÍ   rf  rR   rQ   Úmask_proposalsÚpos_matched_idxsrg  r�   Úmask_featuresrI   r‰  rA   rK   Úrcnn_loss_maskÚrÚmasks_probsr8   Úkeypoint_proposalsÚkeypoint_featuresr¶   rŠ  r·   Úrcnn_loss_keypointÚkeypoints_probsrÇ   Úkeypoint_probÚkpss-   &&&&&                                        r   ÚforwardÚRoIHeads.forwardã  sÊ  € ð ÓÜ�ä(-¯©´U·\±\Ä5Ç:Á:Ð'NÐ$Ø�W•:×#Ñ#Ð+?Ô?Ü#Ð&SÐTUÐV]ÕT^×TdÑTdÐSeÐ$fÓgÐgØ˜•{×(Ñ(¬E¯K©KÔ7Ü#Ð&TÐUVÐW_ÕU`×UfÑUfÐTgÐ$hÓiÐiØ×$Ñ$×&Ô&Ø˜[�>×/Ñ/´5·=±=Ö@Ü'Ð*[Ð\]Ð^iÕ\j×\pÑ\pÐ[qÐ(rÓsÐsñ ð �=�=ˆ=ØBF×B^ÑB^Ð_hÓBrÑ?ˆI VÐ-?àˆFØ!%ÐØˆLà×(Ñ(¨¸lÓKˆØ—}‘} \Ó2ˆØ'+×'9Ñ'9¸,Ó'GÑ$ˆà02ˆØˆØ�=�=ˆ=ØŠ~Ü Ð!8Ó9Ð9Ø!Ò)Ü Ð!DÓEÐEÜ,9¸,ÐX^Ó,sÑ)ˆO˜\Ø'¨¸.È,ÐW‰Fà$(×$?Ñ$?ÀÐ^gÓ$vÑ!ˆE�6˜6Ü˜U›ˆJÜ˜:Ö&�Ø—‘à  q¥Ø  &¨¥)Ø  &¨¥)ðöñ 'ð �=‰=�?‹?Ù28Ó9±&¨Q˜a Ÿj˜j±&ˆNÐ9Ø�}�}ˆ}ØÒ'Ü$Ð%VÓWÐWô ! ›^�
Ø!#�Ø#%Ð Ü# JÖ/�FÜŸ+š+ f¨V¥n°qÑ&8Ó9¸!Õ<�CØ"×)Ñ)¨)°FÕ*;¸CÕ*@ÔAØ$×+Ñ+¨L¸Õ,@ÀÕ,EÖFò 0ð
 $(Ð à×!Ñ!Ò-Ø $× 2Ñ 2°8¸^È\Ó Z�Ø $§¡¨}Ó =�Ø"×1Ñ1°-Ó@‘äÐ GÓHÐHàˆIØ�}�}ˆ}Ø’?Ð&6Ò&>À+ÒBUÜ$Ð%jÓkÐká07Ó8±¨1˜gŸJ˜J±�Ð8Ù29Ó:±'¨Q˜xŸ[˜[±'�	Ð:Ü!.¨{¸NÈHÐV_ÐaqÓ!r�Ø(¨.Ð9‘	á/5Ó6©v¨!˜!˜HŸ+˜+©v�Ð6Ü0°¸fÓE�Ü$'¨°VÖ$<‘L�I˜qØ!*�A�g“Jñ %=ð �M‰M˜)Ô$ð
 ×"Ñ"Ó.Ø×"Ñ"Ó.Ø×'Ñ'Ó3á6<Ó!=±f° ! G§* *±fÐÐ!=Ø�}�}ˆ}ä  ›^�
Ø%'Ð"Ø#%Ð ØÒ'Ü$Ð%WÓXÐXä# JÖ/�FÜŸ+š+ f¨V¥n°qÑ&8Ó9¸!Õ<�CØ&×-Ñ-¨i¸Õ.?ÀÕ.DÔEØ$×+Ñ+¨L¸Õ,@ÀÕ,EÖFò 0ð
 $(Ð à $× 6Ñ 6°xÐASÐUaÓ bÐØ $× 2Ñ 2Ð3DÓ EÐØ"×5Ñ5Ð6GÓHˆOàˆMØ�}�}ˆ}Ø’?Ð&6Ò&>Ü$Ð%qÓrÐrá8?Ó@¹°1 +§ ¹�Ð@Ü%6Ø#Ð%7¸ÐGWó&Ð"ð "1Ð2DÐ E‘à"Ò*Ð.@Ò.HÜ$Øróð ô .DÀOÐUgÓ-hÑ*� Ü-0°À)ÈVÖ-TÑ)�M 3¨Ø%2�A�k‘NØ,/�AÐ(Ó)ñ .Uð �M‰M˜-Ô(àˆ~Ðùòs :ùò8 9ùÚ:ùò 7ùò ">ùò2  As$   È?WÍ;WÎW Î=W%Ð:W*ÕW/)r  r   r!  r  r  r$  r  r)  r*  r(  r&  r'  r%  r#  r  r"  )NNNNNNrV  )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r  r  r  r  Ú__annotations__r  r6  r9  rH  rS  rY  r`  rh  r~  r¢  Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r1  r„  s   @@r   r  r  ø  sr   ù‡ € à�Y×'Ñ'Ø˜I×-Ñ-Ø˜×BÑBð€O÷15òfòò!$òFòò
Uò$CòL91÷vT÷ Tò Tr   r  )rX   )&Útypingr   r   Útorch.nn.functionalr   Ú
functionalr   rª   Útorchvision.opsr   r  r   Ú r   r  r-   r=   rE   rU   rl   r—   ÚjitÚ_script_if_tracingr£   r±   rÄ   rÎ   rÚ   rÝ   Úunusedrà   rç   rõ   rÿ   r  r  ÚModuler  © r   r   Ú<module>r¶     sÝ   ðÝ ã ß Ð Û Ý ß 7å !õ))õXò:8òò@!òH0$ðf ‡�×Ññ ó ð ò"F1òRò>ò ò*ð( ‡�×Ññ_ó ð_ò
òò2!ðH ‡�×Ññó ðôô$ˆr�y‰yö r   