§
    l¬¸jV@  ã                  óœ   — d dl mZ d dlmZ d dlZd dlmc mZ d dlmZ d dl	m
Z
 d dlmZmZmZ  G d„ dej        ¦  «        Z	 	 	 	 ddd„ZdS )é    )Úannotations)ÚAnyN)Únn)Úbbox_iou)Úlinear_sum_assignmentÚ	xywh2xyxyÚ	xyxy2xywhc                  ó@   ‡ — e Zd ZdZ	 	 	 	 	 	 d!d"ˆ fd„Z	 	 d#d$d „Zˆ xZS )%ÚHungarianMatcheraÑ  A module implementing the HungarianMatcher for optimal assignment between predictions and ground truth.

    HungarianMatcher performs optimal bipartite assignment over predicted and ground truth bounding boxes using a cost
    function that considers classification scores, bounding box coordinates, and optionally mask predictions. This is
    used in end-to-end object detection models like DETR.

    Attributes:
        cost_gain (dict[str, float]): Dictionary of cost coefficients for 'class', 'bbox', 'giou', 'mask', and 'dice'
            components.
        use_fl (bool): Whether to use Focal Loss for classification cost calculation.
        with_mask (bool): Whether the model makes mask predictions.
        num_sample_points (int): Number of sample points used in mask cost calculation.
        alpha (float): Alpha factor in Focal Loss calculation.
        gamma (float): Gamma factor in Focal Loss calculation.

    Methods:
        forward: Compute optimal assignment between predictions and ground truths for a batch.
        _cost_mask: Compute mask cost and dice cost if masks are predicted.

    Examples:
        Initialize a HungarianMatcher with custom cost gains
        >>> matcher = HungarianMatcher(cost_gain={"class": 2, "bbox": 5, "giou": 2})

        Perform matching between predictions and ground truth
        >>> pred_boxes = torch.rand(2, 100, 4)  # batch_size=2, num_queries=100
        >>> pred_scores = torch.rand(2, 100, 80)  # 80 classes
        >>> gt_boxes = torch.rand(10, 4)  # 10 ground truth boxes
        >>> gt_classes = torch.randint(0, 80, (10,))
        >>> gt_groups = [5, 5]  # 5 GT boxes per image
        >>> indices = matcher(pred_boxes, pred_scores, gt_boxes, gt_classes, gt_groups)
    NTFé 1  ç      Ð?ç       @Ú	cost_gainúdict[str, float] | NoneÚuse_flÚboolÚ	with_maskÚnum_sample_pointsÚintÚalphaÚfloatÚgammac                ó°   •— t          ¦   «                              ¦   «          |€ddddddœ}|| _        || _        || _        || _        || _        || _        dS )aÉ  Initialize HungarianMatcher for optimal assignment of predicted and ground truth bounding boxes.

        Args:
            cost_gain (dict[str, float], optional): Dictionary of cost coefficients for different matching cost
                components. Should contain keys 'class', 'bbox', 'giou', 'mask', and 'dice'.
            use_fl (bool): Whether to use Focal Loss for classification cost calculation.
            with_mask (bool): Whether the model makes mask predictions.
            num_sample_points (int): Number of sample points used in mask cost calculation.
            alpha (float): Alpha factor in Focal Loss calculation.
            gamma (float): Gamma factor in Focal Loss calculation.
        Né   é   é   )ÚclassÚbboxÚgiouÚmaskÚdice)ÚsuperÚ__init__r   r   r   r   r   r   )Úselfr   r   r   r   r   r   Ú	__class__s          €úl/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/ultralytics/models/utils/ops.pyr#   zHungarianMatcher.__init__0   sc   ø€ õ( 	‰Œ×ÒÑÔÐØÐØ"#¨Q¸À1ÈaÐPÐPˆIØ"ˆŒØˆŒØ"ˆŒØ!2ˆÔØˆŒ
ØˆŒ
ˆ
ˆ
ó    Úpred_bboxesútorch.TensorÚpred_scoresÚ	gt_bboxesÚgt_clsÚ	gt_groupsú	list[int]Úmasksútorch.Tensor | NoneÚgt_maskúlist[torch.Tensor] | NoneÚreturnú'list[tuple[torch.Tensor, torch.Tensor]]c           
     ó–  ‡— |j         \  }}	}
t          ‰¦  «        dk    rd„ t          |¦  «        D ¦   «         S t          j        j        j                             |                     ‰¦  «        d¬¦  «        }t          j        j        j                             |                     ‰¦  «        d¬¦  «        }| 	                    ¦   «         }| j
        r|                     ¦   «         nt          j        |d¬¦  «        }| 	                    ¦   «         }|                     d|dd…df                              d|	d¦  «        ¦  «        }| j
        red	| j        z
  || j        z  z  d	|z
  d
z                        ¦   «          z  }| j        d	|z
  | j        z  z  |d
z                        ¦   «          z  }||z
  }n| }|                     d¦  «        |                     d	¦  «        z
                       ¦   «                              d¦  «        }dt+          |                     d¦  «        |                     d	¦  «        dd¬¦  «                             d¦  «        z
  }| j        d         |z  | j        d         |z  z   | j        d         |z  z   }| j        rš|                      |‰||¦  «                             ||	d¦  «        }|t          j        j        j                             d„ t7          |                     ‰d¦  «        ¦  «        D ¦   «         d¬¦  «                             d	d¦  «        z  }d||                     ¦   «         |                     ¦   «         z  <   |                     ¦   «         }d„ tA          |‰¦  «        D ¦   «         }t          j!        dg‰dd…         ¢¦  «         "                    d¦  «        Šˆfd„t7          |¦  «        D ¦   «         S )a  Compute optimal assignment between predictions and ground truth using Hungarian algorithm.

        This method calculates matching costs based on classification scores, bounding box coordinates, and optionally
        mask predictions, then finds the optimal bipartite assignment between predictions and ground truth.

        Args:
            pred_bboxes (torch.Tensor): Predicted bounding boxes with shape (batch_size, num_queries, 4).
            pred_scores (torch.Tensor): Predicted classification scores with shape (batch_size, num_queries,
                num_classes).
            gt_bboxes (torch.Tensor): Ground truth bounding boxes with shape (num_gts, 4).
            gt_cls (torch.Tensor): Ground truth class labels with shape (num_gts,).
            gt_groups (list[int]): Number of ground truth boxes for each image in the batch.
            masks (torch.Tensor, optional): Predicted masks with shape (batch_size, num_queries, height, width).
            gt_mask (list[torch.Tensor], optional): Ground truth masks, each with shape (num_masks, Height, Width).

        Returns:
            (list[tuple[torch.Tensor, torch.Tensor]]): A list of size batch_size, each element is a tuple (index_i,
                index_j), where index_i is the tensor of indices of the selected predictions (in order) and index_j is
                the tensor of indices of the corresponding selected ground truth targets (in order).
            For each batch element, it holds: len(index_i) = len(index_j) = min(num_queries, num_target_boxes).
        r   c                óŽ   — g | ]B}t          j        g t           j        ¬ ¦  «        t          j        g t           j        ¬ ¦  «        f‘ŒCS ©©Údtype©ÚtorchÚtensorÚlong)Ú.0Ú_s     r&   ú
<listcomp>z,HungarianMatcher.forward.<locals>.<listcomp>p   sB   € ÐpÐpÐpÐab•U”\ "­E¬JÐ7Ñ7Ô7½¼ÀbÕPUÔPZÐ9[Ñ9[Ô9[Ð\ÐpÐpÐpr'   T)Úbatch_firstéÿÿÿÿ©Údimr   Nr   g:Œ0âŽyE>ç      ð?)ÚxywhÚGIoUr   r   r   c                ó.   — g | ]\  }}||         j         ‘ŒS © )ÚT)r>   ÚiÚcs      r&   r@   z,HungarianMatcher.forward.<locals>.<listcomp>“   s"   € ÐNÐNÐN™D˜A˜q��1””ÐNÐNÐNr'   ç        c                óJ   — g | ] \  }}t          |d d …d |…f         ¦  «        ‘Œ!S )N)r   )r>   rL   Úns      r&   r@   z,HungarianMatcher.forward.<locals>.<listcomp>š   s5   € ÐQÐQÐQ±t°q¸!Õ(¨¨1¨1¨1¨b¨q¨b¨5¬Ñ2Ô2ÐQÐQÐQr'   c                ó®   •— g | ]Q\  }\  }}t          j        |t           j        ¬ ¦  «        t          j        |t           j        ¬ ¦  «        ‰|         z   f‘ŒRS r7   r:   )r>   ÚkrK   Újr-   s       €r&   r@   z,HungarianMatcher.forward.<locals>.<listcomp>œ   sd   ø€ ð 
ð 
ð 
á�‘6�A�qõ Œ\˜!¥5¤:Ð.Ñ.Ô.µ´¸QÅeÄjÐ0QÑ0QÔ0QÐT]Ð^_ÔT`Ñ0`Ðað
ð 
ð 
r'   )#ÚshapeÚsumÚranger;   r   ÚutilsÚrnnÚpad_sequenceÚsplitÚdetachr   ÚsigmoidÚFÚsoftmaxÚgatherÚexpandr   r   ÚlogÚ	unsqueezeÚabsr   Úsqueezer   r   Ú
_cost_maskÚviewÚ	enumerateÚ	transposeÚisnanÚisinfÚcpuÚzipÚ	as_tensorÚcumsum_)r$   r(   r*   r+   r,   r-   r/   r1   ÚbsÚnqr?   Úneg_cost_classÚpos_cost_classÚ
cost_classÚ	cost_bboxÚ	cost_giouÚCÚ	mask_costÚindicess        `             r&   ÚforwardzHungarianMatcher.forwardN   s²  ø€ ð>  Ô%‰	ˆˆB�åˆy‰>Œ>˜QÒÐØpÐpÕfkÐlnÑfoÔfoÐpÑpÔpÐpõ ”H”NÔ&×3Ò3°I·O²OÀIÑ4NÔ4NÐ\`Ð3ÑaÔaˆ	Ý””Ô#×0Ò0°·²¸iÑ1HÔ1HÐVZÐ0Ñ[Ô[ˆØ!×(Ò(Ñ*Ô*ˆØ/3¬{Ð^�k×)Ò)Ñ+Ô+Ð+ÅÄ	È+Ð[]Ð@^Ñ@^Ô@^ˆØ!×(Ò(Ñ*Ô*ˆð "×(Ò(¨¨F°1°1°1°d°7¬O×,BÒ,BÀ2ÀrÈ2Ñ,NÔ,NÑOÔOˆØŒ;ð 	&Ø $¤*™n°¸d¼jÑ1HÑIÈqÐS^ÉÐaeÑOe×NjÒNjÑNlÔNlÐMlÑmˆNØ!œZ¨A°©OÀÄ
Ñ+JÑKÐQ\Ð_cÑQc×PhÒPhÑPjÔPjÐOjÑkˆNØ'¨.Ñ8ˆJˆJà%˜ˆJð !×*Ò*¨1Ñ-Ô-°	×0CÒ0CÀAÑ0FÔ0FÑF×KÒKÑMÔM×QÒQÐRTÑUÔUˆ	ð �( ;×#8Ò#8¸Ñ#;Ô#;¸Y×=PÒ=PÐQRÑ=SÔ=SÐZ^ÐeiÐjÑjÔj×rÒrÐsuÑvÔvÑvˆ	ð ŒN˜7Ô# jÑ0ØŒn˜VÔ$ yÑ0ñ1àŒn˜VÔ$ yÑ0ñ1ð 	
ð Œ>ð 	ØŸš¨¨I°u¸gÑFÔF×KÒKÈBÐPRÐTVÑWÔWˆIØ•””Ô#×0Ò0ØNÐN¥I¨i¯oªo¸iÈÑ.LÔ.LÑ$MÔ$MÐNÑNÔNÐ\`ð 1ñ ô çŠi˜˜1‰oŒoñˆAð
 $'ˆˆ!�'Š'‰)Œ)�a—g’g‘i”iÑ
Ñ à�EŠE‰GŒGˆØQÐQ½sÀ1ÀiÑ?PÔ?PÐQÑQÔQˆÝ”O QÐ$8¨°3°B°3¬Ð$8Ñ9Ô9×AÒAÀ!ÑDÔDˆ	ð
ð 
ð 
ð 
å& wÑ/Ô/ð
ñ 
ô 
ð 	
r'   )NTFr   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )NN)r(   r)   r*   r)   r+   r)   r,   r)   r-   r.   r/   r0   r1   r2   r3   r4   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   rx   Ú__classcell__)r%   s   @r&   r   r      sŒ   ø€ € € € € ðð ðD .2ØØØ!&ØØðð ð ð ð ð ð ðJ &*Ø-1ðQ
ð Q
ð Q
ð Q
ð Q
ð Q
ð Q
ð Q
ð Q
r'   r   éd   ç      à?rE   FÚbatchúdict[str, Any]Únum_classesr   Únum_queriesÚclass_embedr)   Únum_dnÚcls_noise_ratior   Úbox_noise_scaleÚtrainingr   r3   ú[tuple[torch.Tensor | None, torch.Tensor | None, torch.Tensor | None, dict[str, Any] | None]c                óN  ‡#‡$‡%— |r|dk    s| €dS | d         }t          t          |¦  «        |¦  «        Š%‰%dk    rdS |‰%z  }	t          |¦  «        }
| d         }| d         Š#| d         }t          j        t          |¦  «        t          j        ‰#j        ¬¦  «        }t          |¦  «        ‰%k    rˆt          j        dg|dd	…         ¢¦  «         	                    d¦  «        }t          j
        ˆ#ˆ%fd
„t          ||¦  «        D ¦   «         ¦  «        }||         ‰#|         ||         c}Š#}ˆ%fd„|D ¦   «         }t          |¦  «        }|                     d|	z  ¦  «        }‰#                     d|	z  d¦  «        }|                     d|	z  ¦  «                             d	¦  «        }t          j        ||	z  t          j        ‰#j        ¬¦  «        |	|z  z   }|dk    rot          j        |j        ¦  «        |dz  k     }t          j        |¦  «                             d	¦  «        }t          j        |d||j        |j        ¬¦  «        }|||<   |dk    r¾t)          |¦  «        }|ddd…f         dz                       dd¦  «        |z  }t          j        |dd¦  «        dz  dz
  }t          j        |¦  «        }||xx         dz  cc<   ||z  }|||z  z  }|                     dd¬¦  «         t/          |¦  «        }t          j        |d¬¦  «        }t3          ‰%dz  |	z  ¦  «        }||         }t          j        |
||j        d	         |j        ¬¦  «        }t          j        |
|d‰#j        ¬¦  «        }t          j
        d„ |D ¦   «         ¦  «        Š$t          j        ˆ$ˆ%fd„t9          |	¦  «        D ¦   «         d¬¦  «        }t          j
        ˆ$ˆ%fd„t9          d|	z  ¦  «        D ¦   «         ¦  «        Š$|||‰$f<   |||‰$f<   ||z   }t          j        ||gt          j        ¬¦  «        } d| |d…d|…f<   t9          |	¦  «        D ]˜}!|!dk    r#d| ‰%dz  |!z  ‰%dz  |!dz   z  …‰%dz  |!dz   z  |…f<   |!|	dz
  k    r!d| ‰%dz  |!z  ‰%dz  |!dz   z  …d‰%|!z  dz  …f<   ŒUd| ‰%dz  |!z  ‰%dz  |!dz   z  …‰%dz  |!dz   z  |…f<   d| ‰%dz  |!z  ‰%dz  |!dz   z  …d‰%dz  |!z  …f<   Œ™d„ |                     ¦   «                              tA          |¦  «        d¬¦  «        D ¦   «         tA          |                     ¦   «                              tA          |¦  «        ¦  «        ¦  «        |	||gdœ}"| !                    |j        ¦  «        | !                    |j        ¦  «        |  !                    |j        ¦  «        |"fS ) a»  Generate contrastive denoising training group with positive and negative samples from ground truths.

    This function creates denoising queries for contrastive denoising training by adding noise to ground truth bounding
    boxes and class labels. It generates both positive and negative samples to improve model robustness.

    Args:
        batch (dict[str, Any]): Batch dictionary containing 'cls' (torch.Tensor with shape (num_gts,)), 'bboxes'
            (torch.Tensor with shape (num_gts, 4)), 'batch_idx' (torch.Tensor), and 'gt_groups' (list[int]) indicating
            number of ground truths per image.
        num_classes (int): Total number of object classes.
        num_queries (int): Number of object queries.
        class_embed (torch.Tensor): Class embedding weights to map labels to embedding space.
        num_dn (int): Number of denoising queries to generate.
        cls_noise_ratio (float): Noise ratio for class labels.
        box_noise_scale (float): Noise scale for bounding box coordinates.
        training (bool): Whether model is in training mode.

    Returns:
        padding_cls (torch.Tensor | None): Modified class embeddings for denoising with shape (bs, num_dn, embed_dim).
        padding_bbox (torch.Tensor | None): Modified bounding boxes for denoising with shape (bs, num_dn, 4).
        attn_mask (torch.Tensor | None): Attention mask for denoising with shape (tgt_size, tgt_size).
        dn_meta (dict[str, Any] | None): Meta information dictionary containing denoising parameters.

    Examples:
        Generate denoising group for training
        >>> batch = {
        ...     "cls": torch.tensor([0, 1, 2]),
        ...     "bboxes": torch.rand(3, 4),
        ...     "batch_idx": torch.tensor([0, 0, 1]),
        ...     "gt_groups": [2, 1],
        ... }
        >>> class_embed = torch.rand(80, 256)  # 80 classes, 256 embedding dim
        >>> cdn_outputs = get_cdn_group(batch, 80, 100, class_embed, training=True)
    r   N)NNNNr-   ÚclsÚbboxesÚ	batch_idx)r9   ÚdevicerB   c                ó�   •— g | ]B\  }}t          j        |‰j        ¬ ¦  «        d‰…                              ¦   «         j        |z   ‘ŒCS )©rŽ   N)r;   ÚrandpermrŽ   ÚsortÚvalues)r>   rO   ÚoÚgt_bboxÚmax_numss      €€r&   r@   z!get_cdn_group.<locals>.<listcomp>  sO   ø€ ÐwÐwÐwÑW[ÐWXÐZ[�UŒ^˜A g¤nÐ5Ñ5Ô5°i°x°iÔ@×EÒEÑGÔGÔNÐQRÑRÐwÐwÐwr'   c                ó0   •— g | ]}t          |‰¦  «        ‘ŒS rI   )Úmin)r>   rO   r–   s     €r&   r@   z!get_cdn_group.<locals>.<listcomp>  s#   ø€ Ð9Ð9Ð9¨!•S˜˜HÑ%Ô%Ð9Ð9Ð9r'   r   r   r   .r   rE   rM   )r˜   Úmaxg�íµ ÷Æ°>)Úepsr�   é   c                óh   — g | ]/}t          j        t          |¦  «        t           j        ¬ ¦  «        ‘Œ0S r7   )r;   r<   rU   r=   )r>   Únums     r&   r@   z!get_cdn_group.<locals>.<listcomp>+  s/   € Ð]Ð]Ð]ÈC�Uœ\­%°©*¬*½E¼JÐGÑGÔGÐ]Ð]Ð]r'   c                ó    •— g | ]
}‰‰|z  z   ‘ŒS rI   rI   ©r>   rK   Úmap_indicesr–   s     €€r&   r@   z!get_cdn_group.<locals>.<listcomp>,  s"   ø€ ÐPÐPÐP¸!˜;¨°A©Ñ5ÐPÐPÐPr'   rC   c                ó    •— g | ]
}‰‰|z  z   ‘ŒS rI   rI   rŸ   s     €€r&   r@   z!get_cdn_group.<locals>.<listcomp>.  s"   ø€ ÐVÐVÐV¸A˜[¨8°a©<Ñ7ÐVÐVÐVr'   r8   Tc                ó8   — g | ]}|                      d ¦  «        ‘ŒS )rB   )Úreshape)r>   Úps     r&   r@   z!get_cdn_group.<locals>.<listcomp>@  s"   € ÐZÐZÐZ¨�q—y’y ‘}”}ÐZÐZÐZr'   )Ú
dn_pos_idxÚ	dn_gt_idxÚdn_num_groupÚdn_num_split)"r˜   r™   Úlenr;   ÚarangerT   r=   rŽ   rl   rm   Úcatrk   Úrepeatre   ÚrandrS   Únonzerorc   Úrandint_liker9   r   Ú	rand_likeÚclip_r	   Úlogitr   ÚzerosÚstackrU   r   rj   rY   ÚlistÚto)&r€   r‚   rƒ   r„   r…   r†   r‡   rˆ   r-   Ú	num_grouprn   r,   Úb_idxÚgt_idxÚoffsetsÚ	total_numÚdn_clsÚdn_bboxÚdn_b_idxÚneg_idxr    ÚidxÚ	new_labelÚ
known_bboxÚdiffÚ	rand_signÚ	rand_partÚdn_cls_embedÚpadding_clsÚpadding_bboxÚpos_idxÚtgt_sizeÚ	attn_maskrK   Údn_metar•   r    r–   s&                                      @@@r&   Úget_cdn_grouprÍ   À   sD  øøø€ ðX ð &˜ 1š˜¨¨Ø%Ð%Ø�kÔ"€IÝ•3�y‘>”> 6Ñ*Ô*€HØ�1‚}€}Ø%Ð%à˜(Ñ"€Iå	ˆY‰Œ€BØ�5Œ\€FØ�HŒo€GØ�+Ô€Eõ
 Œ\�#˜i™.œ.µ´
À7Ä>ÐRÑRÔR€FÝ
ˆ9�~„~˜Ò Ð Ý”/ 1Ð"6 y°°"°¤~Ð"6Ñ7Ô7×?Ò?ÀÑBÔBˆÝ”ØwÐwÐwÐwÐwÕ_bÐclÐnuÑ_vÔ_vÐwÑwÔwñ
ô 
ˆð "(¨¤°¸´À%ÈÄ-Ðˆ�˜Ø9Ð9Ð9Ð9¨yÐ9Ñ9Ô9ˆ	Ý�I‘”€Ið �]Š]˜1˜y™=Ñ)Ô)€FØ�nŠn˜Q ™]¨AÑ.Ô.€GØ�|Š|˜A 	™MÑ*Ô*×/Ò/°Ñ3Ô3€Hõ Œl˜9 yÑ0½¼
È7Ì>ÐZÑZÔZÐ]fÐirÑ]rÑr€Gà˜ÒÐåŒz˜&œ,Ñ'Ô'¨?¸SÑ+@ÒAˆÝŒm˜DÑ!Ô!×)Ò)¨"Ñ-Ô-ˆåÔ& s¨A¨{À&Ä,ÐW]ÔWdÐeÑeÔeˆ	Øˆˆs‰à˜ÒÐÝ˜wÑ'Ô'ˆ
à˜˜Q˜R˜R˜Ô  3Ñ&×.Ò.¨q°!Ñ4Ô4°ÑFˆåÔ& w°°1Ñ5Ô5¸Ñ;¸cÑAˆ	Ý”O GÑ,Ô,ˆ	Ø�'ÐÐÔ˜cÑ!ÐÐÑØ�YÑˆ	Ø�i $Ñ&Ñ&ˆ
Ø×Ò˜S cÐÑ*Ô*Ð*Ý˜JÑ'Ô'ˆÝ”+˜g¨4Ð0Ñ0Ô0ˆå�˜A‘ 	Ñ)Ñ*Ô*€FØ˜vÔ&€LÝ”+˜b &¨,Ô*<¸RÔ*@ÈÌÐWÑWÔW€KÝ”;˜r 6¨1°W´^ÐDÑDÔD€Lå”)Ð]Ð]ÐS\Ð]Ñ]Ô]Ñ^Ô^€KÝŒkÐPÐPÐPÐPÐP½uÀYÑ?OÔ?OÐPÑPÔPÐVWÐXÑXÔX€Gå”)ÐVÐVÐVÐVÐVÅÀqÈ9Á}ÑAUÔAUÐVÑVÔVÑWÔW€KØ+7€K�˜;Ð'Ñ(Ø,3€L�(˜KÐ(Ñ)à˜Ñ#€HÝ”˜X xÐ0½¼
ÐCÑCÔC€Ià"&€Iˆfˆgˆg�w˜�wÐÑå�9ÑÔð \ð \ˆØ�Š6ˆ6ØdhˆI�h ‘l QÑ&¨°A©¸¸Q¹Ñ)?Ð?ÀÈAÁÐQRÐUVÑQVÑAWÐZ`ÐA`Ð`ÑaØ�	˜A‘ÒÐØW[ˆI�h ‘l QÑ&¨°A©¸¸Q¹Ñ)?Ð?ÐASÀ8ÈaÁ<ÐRSÑCSÐASÐSÑTÐTàdhˆI�h ‘l QÑ&¨°A©¸¸Q¹Ñ)?Ð?ÀÈAÁÐQRÐUVÑQVÑAWÐZ`ÐA`Ð`ÑaØW[ˆI�h ‘l QÑ&¨°A©¸¸Q¹Ñ)?Ð?ÐASÀ8ÈaÁ<ÐRSÑCSÐASÐSÑTÐTàZÐZ¨g¯kªk©m¬m×.AÒ.AÅ$ÀyÁ/Ä/ÐWXÐ.AÑ.YÔ.YÐZÑZÔZÝ˜&Ÿ*š*™,œ,×,Ò,­T°)©_¬_Ñ=Ô=Ñ>Ô>Ø!Ø Ð-ð	ð €Gð 	�Š�{Ô)Ñ*Ô*Ø�Š˜Ô*Ñ+Ô+Ø�Š�[Ô'Ñ(Ô(Øð	ð r'   )r~   r   rE   F)r€   r�   r‚   r   rƒ   r   r„   r)   r…   r   r†   r   r‡   r   rˆ   r   r3   r‰   )Ú
__future__r   Útypingr   r;   Útorch.nn.functionalr   Ú
functionalr\   Úultralytics.utils.metricsr   Úultralytics.utils.opsr   r   r	   ÚModuler   rÍ   rI   r'   r&   ú<module>rÕ      sþ   ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à .Ð .Ð .Ð .Ð .Ð .Ø MÐ MÐ MÐ MÐ MÐ MÐ MÐ MÐ MÐ MðP
ð P
ð P
ð P
ð P
�r”yñ P
ô P
ð P
ðl Ø Ø ØðKð Kð Kð Kð Kð Kð Kr'   