§
    ‚ŠtjÌ=  ã                   ó  — d dl Z d dlm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  e¦   «         rd dlmZ d„ Z	 dd	„Zd
ede j        dede j        fd„Zde j        d
edede j        fd„Zdd„Z G d„ de¦  «        Z	 	 	 	 	 	 	 dd„ZdS )é    Né   )Úis_vision_availableé   )Úbox_iou)ÚRTDetrHungarianMatcherÚ
RTDetrLoss)Úcenter_to_corners_formatc                 ó6   — d„ t          | |¦  «        D ¦   «         S )Nc                 ó   — g | ]
\  }}||d œ‘ŒS ))ÚlogitsÚ
pred_boxes© )Ú.0ÚaÚbs      ú[/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/loss/loss_d_fine.pyú
<listcomp>z!_set_aux_loss.<locals>.<listcomp>   s$   € ÐYÐYÐY©t¨q°!�q¨Ð*Ð*ÐYÐYÐYó    ©Úzip)Úoutputs_classÚoutputs_coords     r   Ú_set_aux_lossr      s    € ØYÐYµs¸=È-Ñ7XÔ7XÐYÑYÔYÐYr   c                 óD   ‡‡— ˆˆfd„t          | |||¦  «        D ¦   «         S )Nc           	      ó,   •— g | ]\  }}}}||||‰‰d œ‘ŒS ))r   r   Úpred_cornersÚ
ref_pointsÚteacher_cornersÚteacher_logitsr   )r   r   r   ÚcÚdr   r   s        €€r   r   z"_set_aux_loss2.<locals>.<listcomp>$   sL   ø€ ð 
ð 
ð 
ñ ˆAˆq�!�Qð ØØØØ.Ø,ð	
ð 	
ð
ð 
ð 
r   r   )r   r   Úoutputs_cornersÚoutputs_refr   r   s       ``r   Ú_set_aux_loss2r$   !   sD   øø€ ð
ð 
ð 
ð 
ð 
õ ˜m¨]¸OÈ[ÑYÔYð
ñ 
ô 
ð 
r   Úmax_num_binsÚupÚ	reg_scaleÚreturnc                 óä  ‡— t          |d         ¦  «        t          |¦  «        z  }t          |d         ¦  «        t          |¦  «        z  dz  }|dz   d| dz
  z  z  Šˆfd„t          | dz  dz
  dd¦  «        D ¦   «         }ˆfd„t          d| dz  ¦  «        D ¦   «         }| g|z   t          j        |d         d         ¦  «        gz   |z   |gz   }d„ |D ¦   «         }t          j        |d¦  «        }|S )	uK  
    Generates the non-uniform Weighting Function W(n) for bounding box regression.

    Args:
        max_num_bins (int): Max number of the discrete bins.
        up (Tensor): Controls upper bounds of the sequence,
                     where maximum offset is Â±up * H / W.
        reg_scale (float): Controls the curvature of the Weighting Function.
                           Larger values result in flatter weights near the central axis W(max_num_bins/2)=0
                           and steeper weights at both ends.
    Returns:
        Tensor: Sequence of Weighting Function.
    r   r   r   c                 ó"   •— g | ]}‰|z   d z   ‘ŒS ©r   r   ©r   ÚiÚsteps     €r   r   z&weighting_function.<locals>.<listcomp>B   s$   ø€ ÐSÐSÐS¨!�d˜q‘[�> AÑ%ÐSÐSÐSr   éÿÿÿÿc                 ó    •— g | ]
}‰|z  d z
  ‘ŒS r+   r   r,   s     €r   r   z&weighting_function.<locals>.<listcomp>C   s!   ø€ ÐIÐIÐI¨�T˜a‘K !‘OÐIÐIÐIr   Nc                 ól   — g | ]1}|                      ¦   «         d k    r|n|                     d ¦  «        ‘Œ2S )r   )ÚdimÚ	unsqueeze)r   Úvs     r   r   z&weighting_function.<locals>.<listcomp>E   s6   € ÐCÐCÐC°q�1—5’5‘7”7˜Q’;�;ˆaˆa A§K¢K°¡N¤NÐCÐCÐCr   )ÚabsÚrangeÚtorchÚ
zeros_likeÚcat)	r%   r&   r'   Úupper_bound1Úupper_bound2Úleft_valuesÚright_valuesÚvaluesr.   s	           @r   Úweighting_functionr?   1   s  ø€ õ �r˜!”u‘:”:¥ I¡¤Ñ.€LÝ�r˜!”u‘:”:¥ I¡¤Ñ.°Ñ2€LØ˜1Ñ ! |°aÑ'7Ñ"8Ñ9€DØSÐSÐSÐS­u°\ÀQÑ5FÈÑ5JÈAÈrÑ/RÔ/RÐSÑSÔS€KØIÐIÐIÐI­U°1°lÀaÑ6GÑ-HÔ-HÐIÑIÔI€LØˆmˆ_˜{Ñ*­eÔ.>¸rÀ!¼uÀT¼{Ñ.KÔ.KÐ-LÑLÈ|Ñ[Ð_kÐ^lÑl€FØCÐC¸FÐCÑCÔC€FÝŒY�v˜qÑ!Ô!€FØ€Mr   Úgtc                 óØ  — |                       d¦  «        } t          |||¦  «        }|                     d¦  «        |                      d¦  «        z
  }|dk    }t          j        |d¬¦  «        dz
  }|                     ¦   «         }t          j        |¦  «        }	t          j        |¦  «        }
|dk    ||k     z  }||                              ¦   «         }||         }||dz            }t          j        | |         |z
  ¦  «        }t          j        || |         z
  ¦  «        }|||z   z  |	|<   d|	|         z
  |
|<   |dk     }d|	|<   d|
|<   d||<   ||k    }d|	|<   d|
|<   |dz
  ||<   ||	|
fS )a	  
    Decodes bounding box ground truth (GT) values into distribution-based GT representations.

    This function maps continuous GT values into discrete distribution bins, which can be used
    for regression tasks in object detection models. It calculates the indices of the closest
    bins to each GT value and assigns interpolation weights to these bins based on their proximity
    to the GT value.

    Args:
        gt (Tensor): Ground truth bounding box values, shape (N, ).
        max_num_bins (int): Maximum number of discrete bins for the distribution.
        reg_scale (float): Controls the curvature of the Weighting Function.
        up (Tensor): Controls the upper bounds of the Weighting Function.

    Returns:
        tuple[Tensor, Tensor, Tensor]:
            - indices (Tensor): Index of the left bin closest to each GT value, shape (N, ).
            - weight_right (Tensor): Weight assigned to the right bin, shape (N, ).
            - weight_left (Tensor): Weight assigned to the left bin, shape (N, ).
    r/   r   r   ©r2   g      ð?g        çš™™™™™¹?)	Úreshaper?   r3   r7   ÚsumÚfloatr8   Úlongr5   )r@   r%   r'   r&   Úfunction_valuesÚdiffsÚmaskÚclosest_left_indicesÚindicesÚweight_rightÚweight_leftÚvalid_idx_maskÚvalid_indicesr<   r=   Ú
left_diffsÚright_diffsÚinvalid_idx_mask_negÚinvalid_idx_mask_poss                      r   Útranslate_gtrU   J   s©  € ð* 
�Š�B‰Œ€BÝ(¨°r¸9ÑEÔE€Oð ×%Ò% aÑ(Ô(¨2¯<ª<¸©?¬?Ñ:€EØ�AŠ:€DÝ œ9 T¨qÐ1Ñ1Ô1°AÑ5Ðð #×(Ò(Ñ*Ô*€GåÔ# GÑ,Ô,€LÝÔ" 7Ñ+Ô+€Kà ’l w°Ò'=Ñ>€NØ˜NÔ+×0Ò0Ñ2Ô2€Mð " -Ô0€KØ" =°1Ñ#4Ô5€Lå”˜2˜nÔ-°Ñ;Ñ<Ô<€JÝ”)˜L¨2¨nÔ+=Ñ=Ñ>Ô>€Kð $.°¸kÑ1IÑ#J€L�Ñ Ø"%¨°^Ô(DÑ"D€K�Ñð # Qš;ÐØ),€LÐ%Ñ&Ø(+€KÐ$Ñ%Ø$'€GÐ Ñ!à" lÒ2ÐØ),€LÐ%Ñ&Ø(+€KÐ$Ñ%Ø$0°3Ñ$6€GÐ Ñ!à�L +Ð-Ð-r   rC   c                 óÂ  — t          |¦  «        }| dd…df         |dd…df         z
  | d         |z  dz   z  d|z  z
  }| dd…df         |dd…df         z
  | d         |z  dz   z  d|z  z
  }|dd…df         | dd…df         z
  | d         |z  dz   z  d|z  z
  }|dd…d	f         | dd…df         z
  | d         |z  dz   z  d|z  z
  }	t          j        ||||	gd
¦  «        }
t          |
|||¦  «        \  }
}}|�|
                     d||z
  ¬¦  «        }
|
                     d
¦  «                             ¦   «         |                     ¦   «         |                     ¦   «         fS )aú  
    Converts bounding box coordinates to distances from a reference point.

    Args:
        points (Tensor): (n, 4) [x, y, w, h], where (x, y) is the center.
        bbox (Tensor): (n, 4) bounding boxes in "xyxy" format.
        max_num_bins (float): Maximum bin value.
        reg_scale (float): Controlling curvarture of W(n).
        up (Tensor): Controlling upper bounds of W(n).
        eps (float): Small value to ensure target < max_num_bins.

    Returns:
        Tensor: Decoded distances.
    Nr   ).r   g¼‰Ø—²Òœ<ç      à?r   ).é   r   rX   r/   ©ÚminÚmax)r5   r7   ÚstackrU   ÚclamprD   Údetach)ÚpointsÚbboxr%   r'   r&   ÚepsÚleftÚtopÚrightÚbottomÚ	four_lensrM   rN   s                r   Úbbox2distancerg   ‰   s¦  € õ  �I‘”€IØ�1�1�1�a�4ŒL˜4    1 œ:Ñ%¨&°¬.¸9Ñ*DÀuÑ*LÑMÐPSÐV_ÑP_Ñ_€DØ�!�!�!�Q�$Œ<˜$˜q˜q˜q !˜tœ*Ñ$¨°¬¸)Ñ)CÀeÑ)KÑ
LÈsÐU^ÉÑ
^€CØ�!�!�!�Q�$ŒZ˜&    A œ,Ñ&¨6°&¬>¸IÑ+EÈÑ+MÑNÐQTÐW`ÑQ`Ñ`€EØ�1�1�1�a�4Œj˜6 ! ! ! Q $œ<Ñ'¨F°6¬N¸YÑ,FÈÑ,NÑOÐRUÐXaÑRaÑa€FÝ”˜T 3¨¨vÐ6¸Ñ;Ô;€IÝ+7¸	À<ÐQZÐ\^Ñ+_Ô+_Ñ(€Iˆ|˜[ØÐØ—O’O¨¨|¸cÑ/A�OÑBÔBˆ	Ø×Ò˜RÑ Ô ×'Ò'Ñ)Ô)¨<×+>Ò+>Ñ+@Ô+@À+×BTÒBTÑBVÔBVÐVÐVr   c                   ó:   ‡ — e Zd ZdZˆ fd„Z	 d	d„Zd
d„Zd„ Zˆ xZS )Ú	DFineLossa�  
    This class computes the losses for D-FINE. The process happens in two steps: 1) we compute hungarian assignment
    between ground truth boxes and the outputs of the model 2) we supervise each pair of matched ground-truth /
    prediction (supervise class and box).

    Args:
        matcher (`DetrHungarianMatcher`):
            Module able to compute a matching between targets and proposals.
        weight_dict (`Dict`):
            Dictionary relating each loss with its weights. These losses are configured in DFineConf as
            `weight_loss_vfl`, `weight_loss_bbox`, `weight_loss_giou`, `weight_loss_fgl`, `weight_loss_ddf`
        losses (`list[str]`):
            List of all the losses to be applied. See `get_loss` for a list of all available losses.
        alpha (`float`):
            Parameter alpha used to compute the focal loss.
        gamma (`float`):
            Parameter gamma used to compute the focal loss.
        eos_coef (`float`):
            Relative classification weight applied to the no-object category.
        num_classes (`int`):
            Number of object categories, omitting the special no-object category.
    c                 óf  •— t          ¦   «                              |¦  «         t          |¦  «        | _        |j        | _        |j        |j        |j        |j        |j	        dœ| _
        g d¢| _        |j        | _        t          j        t          j        |j        g¦  «        d¬¦  «        | _        d S )N)Úloss_vflÚ	loss_bboxÚ	loss_giouÚloss_fglÚloss_ddf)ÚvflÚboxesÚlocalF)Úrequires_grad)ÚsuperÚ__init__r   Úmatcherr%   Úweight_loss_vflÚweight_loss_bboxÚweight_loss_giouÚweight_loss_fglÚweight_loss_ddfÚweight_dictÚlossesr'   ÚnnÚ	Parameterr7   Útensorr&   )ÚselfÚconfigÚ	__class__s     €r   ru   zDFineLoss.__init__½   s£   ø€ Ý‰Œ×Ò˜Ñ Ô Ð å-¨fÑ5Ô5ˆŒØ"Ô/ˆÔàÔ.ØÔ0ØÔ0ØÔ.ØÔ.ð
ð 
ˆÔð 0Ð/Ð/ˆŒØÔ)ˆŒÝ”,�uœ|¨V¬Y¨KÑ8Ô8ÈÐNÑNÔNˆŒˆˆr   NrE   c                 óÂ  — |                      ¦   «         }|dz   }	t          j        ||d¬¦  «        |                     d¦  «        z  t          j        ||	d¬¦  «        |                     d¦  «        z  z   }
|�|                     ¦   «         }|
|z  }
|�|
                     ¦   «         |z  }
n5|dk    r|
                     ¦   «         }
n|dk    r|
                     ¦   «         }
|
S )Nr   Únone©Ú	reductionr/   ÚmeanrE   )rG   ÚFÚcross_entropyrD   rF   rE   rˆ   )r�   ÚpredÚlabelrM   rN   Úweightr‡   Ú
avg_factorÚdis_leftÚ	dis_rightÚlosss              r   Ú unimodal_distribution_focal_lossz*DFineLoss.unimodal_distribution_focal_lossÍ   sî   € ð —:’:‘<”<ˆØ˜q‘Lˆ	åŒ˜t X¸Ð@Ñ@Ô@À;×CVÒCVÐWYÑCZÔCZÑZÕ]^Ô]lØ�) vð^
ñ ^
ô ^
à× Ò  Ñ$Ô$ñ^%ñ %ˆð ÐØ—\’\‘^”^ˆFØ˜&‘=ˆDàÐ!Ø—8’8‘:”: 
Ñ*ˆDˆDØ˜&Ò Ð Ø—9’9‘;”;ˆDˆDØ˜%ÒÐØ—8’8‘:”:ˆDàˆr   é   c                 óV	  — i }d|v �r¡|                       |¦  «        }t          j        d„ t          ||¦  «        D ¦   «         d¬¦  «        }|d         |                              d| j        dz   ¦  «        }	|d         |                              ¦   «         }
t          j        ¦   «         5  t          |
t          |¦  «        | j        | j
        | j        ¦  «        | _        ddd¦  «         n# 1 swxY w Y   | j        \  }}}t          j        t          t          |d	         |         ¦  «        t          |¦  «        ¦  «        d         ¦  «        }|                     d¦  «                             ddd
¦  «                             d¦  «                             ¦   «         }|                      |	|||||¬¦  «        |d<   |d                              d| j        dz   ¦  «        }	|d                              d| j        dz   ¦  «        }t          j        |	|¦  «        r|	                     ¦   «         dz  |d<   �nv|d                              ¦   «                              d¬¦  «        d         }t          j        |t          j        ¬¦  «        }d||<   |                     d¦  «                             ddd
¦  «                             d¦  «        }|                     ||         ¦  «                             |j        ¦  «        ||<   |                     d¦  «                             ddd
¦  «                             d¦  «                             ¦   «         }||dz  z   t7          j        d¬¦  «        t;          j        |	|z  d¬¦  «        t;          j        |                     ¦   «         |z  d¬¦  «        ¦  «                             d¦  «        z  }d|d	         j         d         z  }|                     ¦   «         |z  dz  |                      ¦   «         |z  dz  c| _!        | _"        | #                    ¦   «         r||          $                    ¦   «         nd}|  #                    ¦   «         r||           $                    ¦   «         nd}|| j!        z  || j"        z  z   | j!        | j"        z   z  |d<   |S )zaCompute Fine-Grained Localization (FGL) Loss
        and Decoupled Distillation Focal (DDF) Loss.r   c                 ó6   — g | ]\  }\  }}|d          |         ‘ŒS )rq   r   )r   ÚtÚ_r-   s       r   r   z(DFineLoss.loss_local.<locals>.<listcomp>ë   s(   € Ð%[Ð%[Ð%[¹	¸¹6¸A¸q a¨¤j°¤mÐ%[Ð%[Ð%[r   r   rB   r/   r   r   Nr   é   )rŽ   rn   r   ro   r   )ÚdtypeTr   r…   r†   rW   )%Ú_get_source_permutation_idxr7   r9   r   rD   r%   r^   Úno_gradrg   r	   r'   r&   Úfgl_targetsÚdiagr   r3   Úrepeatr’   ÚequalrE   Úsigmoidr[   r8   ÚboolÚ
reshape_asÚtor™   r~   Ú	KLDivLossr‰   Úlog_softmaxÚsoftmaxÚshapeÚnum_posÚnum_negÚanyrˆ   )r�   ÚoutputsÚtargetsrL   Ú	num_boxesÚTr}   ÚidxÚtarget_boxesr   r   Útarget_cornersrM   rN   ÚiousÚweight_targetsÚweight_targets_localrJ   Úloss_match_localÚbatch_scaleÚloss_match_local1Úloss_match_local2s                         r   Ú
loss_localzDFineLoss.loss_localä   sÈ  € ð ˆØ˜WÐ$Ñ$Ø×2Ò2°7Ñ;Ô;ˆCÝ œ9Ð%[Ð%[ÅSÈÐRYÑEZÔEZÐ%[Ñ%[Ô%[ÐabÐcÑcÔcˆLà" >Ô2°3Ô7×?Ò?ÀÀTÔEVÐYZÑEZÑ\Ô\ˆLØ  Ô.¨sÔ3×:Ò:Ñ<Ô<ˆJÝ”‘”ð ð Ý#0ØÝ,¨\Ñ:Ô:ØÔ%Ø”NØ”Gñ$ô $�Ô ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð 9=Ô8HÑ5ˆN˜L¨+å”:ÝÕ0°¸Ô1FÀsÔ1KÑLÔLÕNfÐgsÑNtÔNtÑuÔuØôñô ˆDð
 "Ÿ^š^¨BÑ/Ô/×6Ò6°q¸!¸QÑ?Ô?×GÒGÈÑKÔK×RÒRÑTÔTˆNà!%×!FÒ!FØØØØØØ$ð "Gñ "ô "ˆF�:Ñð # >Ô2×:Ò:¸2ÀÔ@QÐTUÑ@UÑWÔWˆLØ$Ð%6Ô7×?Ò?ÀÀTÔEVÐYZÑEZÑ\Ô\ˆNÝŒ{˜<¨Ñ8Ô8ð Ø%1×%5Ò%5Ñ%7Ô%7¸!Ñ%;��zÑ"Ñ"à'.Ð/?Ô'@×'HÒ'HÑ'JÔ'J×'NÒ'NÐSUÐ'NÑ'VÔ'VÐWXÔ'YÐ$ÝÔ'Ð(<ÅEÄJÐOÑOÔO�Ø ��S‘	Ø—~’~ bÑ)Ô)×0Ò0°°A°qÑ9Ô9×AÒAÀ"ÑEÔE�à,0¯OªOÐ<PÐQTÔ<UÑ,VÔ,V×,YÒ,YÐZnÔZtÑ,uÔ,uÐ$ SÑ)Ø';×'EÒ'EÀbÑ'IÔ'I×'PÒ'PÐQRÐTUÐWXÑ'YÔ'Y×'aÒ'aÐbdÑ'eÔ'e×'lÒ'lÑ'nÔ'nÐ$ð )Ø˜!‘tñð 7�œ¨vÐ6Ñ6Ô6ÝœM¨,¸Ñ*:ÀÐBÑBÔBÝœI n×&;Ò&;Ñ&=Ô&=ÀÑ&AÀqÐIÑIÔIñô ÷ ’c˜"‘g”gñð !ð   '¨,Ô"7Ô"=¸aÔ"@Ñ@�à—X’X‘Z”Z +Ñ-°#Ñ5Ø�e—[’[‘]”] [Ñ0°SÑ8ð +�”˜dœlð FJÇXÂXÁZÄZÐ$VÐ$4°TÔ$:×$?Ò$?Ñ$AÔ$AÐ$AÐUVÐ!ØHLÀuÇkÂkÁmÄmÐ$ZÐ$4°d°UÔ$;×$@Ò$@Ñ$BÔ$BÐ$BÐYZÐ!Ø&7¸$¼,Ñ&FÐIZÐ]aÔ]iÑIiÑ&iØ”L 4¤<Ñ/ñ&��zÑ"ð ˆs   Â(5C)Ã)C-Ã0C-c                 óš   — | j         | j        | j        | j        | j        dœ}||vrt          d|› d�¦  «        ‚ ||         ||||¦  «        S )N)Úcardinalityrr   rq   Úfocalrp   zLoss z not supported)Úloss_cardinalityr¹   Ú
loss_boxesÚloss_labels_focalÚloss_labels_vflÚ
ValueError)r�   r‘   r«   r¬   rL   r­   Úloss_maps          r   Úget_losszDFineLoss.get_loss/  sk   € àÔ0Ø”_Ø”_ØÔ+ØÔ'ð
ð 
ˆð �xÐÐÝÐ9 TÐ9Ð9Ð9Ñ:Ô:Ð:Øˆx˜Œ~˜g w°¸ÑCÔCÐCr   )NrE   N)r“   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ru   r’   r¹   rÃ   Ú__classcell__)rƒ   s   @r   ri   ri   ¥   s‘   ø€ € € € € ðð ð.Oð Oð Oð Oð Oð" `dðð ð ð ð.Ið Ið Ið IðV
Dð 
Dð 
Dð 
Dð 
Dð 
Dð 
Dr   ri   c           
      ó`  — t          |¦  «        }|                     |¦  «         i }| |d<   |                     dd¬¦  «        |d<   d }|j        �r.|	�–t	          j        |                     dd¬¦  «        |	d         d¬¦  «        \  }}t	          j        ||	d         d¬¦  «        \  }}t	          j        |
|	d         d¬¦  «        \  }}t	          j        ||	d         d¬¦  «        \  }}n|                     dd¬¦  «        }|}|
}|}|j        �rqt          |d d …d d	…f                              dd¦  «        |d d …d d	…f                              dd¦  «        |d d …d d	…f                              dd¦  «        |d d …d d	…f                              dd¦  «        |d d …d	f         |d d …d	f         ¦  «        }||d
<   |d
                              t          |g|                     dd¬¦  «        g¦  «        ¦  «         |	�‚t          |                     dd¦  «        |                     dd¦  «        |                     dd¦  «        |                     dd¦  «        |d d …d	f         |d d …d	f         ¦  «        }||d<   |	|d<    |||¦  «        }t          |                     ¦   «         ¦  «        }|||fS )Nr   r   r   rY   r   Údn_num_splitr   rB   r/   Úauxiliary_outputsÚdn_auxiliary_outputsÚdenoising_meta_values)ri   r£   r]   Úauxiliary_lossr7   Úsplitr$   Ú	transposeÚextendr   rE   r>   )r   ÚlabelsÚdevicer   r‚   r   r   Úenc_topk_logitsÚenc_topk_bboxesrÍ   Úpredicted_cornersÚinitial_reference_pointsÚkwargsÚ	criterionÚoutputs_lossrË   Údn_out_coordÚnormal_out_coordÚdn_out_classÚnormal_out_classÚdn_out_cornersÚout_cornersÚdn_out_refsÚout_refsrÌ   Ú	loss_dictr‘   s                              r   ÚDFineForObjectDetectionLossrä   <  s1  € õ ˜&Ñ!Ô!€IØ‡L‚L�ÑÔÐà€LØ#€L�ÑØ!+×!1Ò!1°a¸QÐ!1Ñ!?Ô!?€L�ÑØÐØÔñ &NØ Ð,Ý-2¬[Ø×#Ò#¨¨qÐ#Ñ1Ô1Ð3HÈÔ3XÐ^_ð.ñ .ô .Ñ*ˆLÐ*õ .3¬[¸ÐH]Ð^lÔHmÐstÐ-uÑ-uÔ-uÑ*ˆLÐ*Ý*/¬+Ð6GÐI^Ð_mÔInÐtuÐ*vÑ*vÔ*vÑ'ˆN˜KÝ$)¤KÐ0HÐJ_Ð`nÔJoÐuvÐ$wÑ$wÔ$wÑ!ˆK˜˜à,×2Ò2°q¸aÐ2Ñ@Ô@ÐØ,ÐØ+ˆKØ/ˆHàÔ ñ 	NÝ .Ø     C R C Ô(×2Ò2°1°aÑ8Ô8Ø     C R C Ô(×2Ò2°1°aÑ8Ô8Ø˜A˜A˜A˜s ˜s˜FÔ#×-Ò-¨a°Ñ3Ô3Ø˜˜˜˜C˜R˜C˜Ô ×*Ò*¨1¨aÑ0Ô0Ø˜A˜A˜A˜r˜EÔ"Ø     B Ô'ñ!ô !Ðð 1BˆLÐ,Ñ-ØÐ,Ô-×4Ò4Ý˜Ð/°/×2GÒ2GÈAÐSTÐ2GÑ2UÔ2UÐ1VÑWÔWñô ð ð %Ð0Ý'5Ø ×*Ò*¨1¨aÑ0Ô0Ø ×*Ò*¨1¨aÑ0Ô0Ø"×,Ò,¨Q°Ñ2Ô2Ø×)Ò)¨!¨QÑ/Ô/Ø" 1 1 1 b 5Ô)Ø     B Ô'ñ(ô (Ð$ð 8L�Ð3Ñ4Ø8M�Ð4Ñ5à�	˜,¨Ñ/Ô/€Iåˆy×ÒÑ!Ô!Ñ"Ô"€DØ�Ð-Ð-Ð-r   )NN)rC   )NNNNNNN)r7   Útorch.nnr~   Útorch.nn.functionalÚ
functionalr‰   Úutilsr   Úloss_for_object_detectionr   Úloss_rt_detrr   r   Útransformers.image_transformsr	   r   r$   ÚintÚTensorr?   rU   rg   ri   rä   r   r   r   ú<module>rî      sÃ  ðð  €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ð Ð Ð à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø .Ð .Ð .Ð .Ð .Ð .Ø <Ð <Ð <Ð <Ð <Ð <Ð <Ð <ð ÐÑÔð GØFÐFÐFÐFÐFÐFðZð Zð Zð
 fjðð ð ð ð  Sð ¨e¬lð Àsð ÈuÌ|ð ð ð ð ð2<.�U”\ð <.°ð <.Àð <.È%Ì,ð <.ð <.ð <.ð <.ð~Wð Wð Wð Wð8TDð TDð TDð TDð TD�
ñ TDô TDð TDðz ØØØØØØ!ðA.ð A.ð A.ð A.ð A.ð A.r   