+
     °³jA  ã                   óx   € R t ^ RIt^ RIHt ^ RIHtHt ^ RIt^ RIHt ^RI	H
t
  ! R R]P                  4      tR# )z,
Implements the Generalized R-CNN framework
N)ÚOrderedDict)ÚOptionalÚUnion)Únn)Ú_log_api_usage_oncec                   óœ   a a€ ] tR t^t oRtV3R lV 3R llt]P                  P                  V3R lR l4       t	R	V3R lR llt
RtVtV ;t# )
ÚGeneralizedRCNNa@  
Main class for Generalized R-CNN.

Args:
    backbone (nn.Module):
    rpn (nn.Module):
    roi_heads (nn.Module): takes the features + the proposals from the RPN and computes
        detections / masks from it.
    transform (nn.Module): performs the data transformation from the inputs to feed into
        the model
c          
      ó†   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[ P                  RS[ P                  RR/# )é   ÚbackboneÚrpnÚ	roi_headsÚ	transformÚreturnN)r   ÚModule)ÚformatÚ__classdict__s   "€Ún/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/models/detection/generalized_rcnn.pyÚ__annotate__ÚGeneralizedRCNN.__annotate__   sM   ø€ ÷ !ñ !á—)‘)ð!ñ �Y‰Yð!ñ —9‘9ð	!ñ
 —9‘9ð!ð 
ñ!ó    c                óx   <€ \         SV `  4        \        V 4       W@n        Wn        W n        W0n        R V n        R# )FN)ÚsuperÚ__init__r   r   r   r   r   Ú_has_warned)Úselfr   r   r   r   Ú	__class__s   &&&&&€r   r   ÚGeneralizedRCNN.__init__   s4   ø€ ô 	‰ÑÔÜ˜DÔ!Ø"ŒØ ŒØŒØ"Œà ˆÖr   c                ó
  <€ V ^8„  d   QhRS[ S[S[P                  3,          RS[S[ S[S[P                  3,          ,          RS[S[ S[S[P                  3,          S[S[ S[S[P                  3,          ,          3,          /# )r
   ÚlossesÚ
detectionsr   )ÚdictÚstrÚtorchÚTensorÚlistr   )r   r   s   "€r   r   r   -   sq   ø€ ÷ ñ Ù™3¡§¡Ð,Õ-ðÙ;?ÁÁSÉ%Ï,É,ÐEVÕ@WÕ;Xðá	‰t‘C™Ÿ™Ð%Õ&©©T±#±u·|±|Ð2CÕ-DÕ(EÐEÕ	Fñr   c                ó.   € V P                   '       d   V# V# ©N)Útraining)r   r   r    s   &&&r   Úeager_outputsÚGeneralizedRCNN.eager_outputs,   s   € ð �=�=ˆ=ØˆMàÐr   c                ó  <€ V ^8„  d   QhRS[ S[P                  ,          RS[S[ S[S[S[P                  3,          ,          ,          RS[S[S[S[P                  3,          S[ S[S[S[P                  3,          ,          3,          /# )r
   ÚimagesÚtargetsr   )r%   r#   r$   r   r!   r"   Útuple)r   r   s   "€r   r   r   5   sz   ø€ ÷ P:ñ P:á‘U—\‘\Õ"ðP:ñ ™$™t¡C©¯©Ð$5Õ6Õ7Õ8ðP:ñ 
‰t‘C™Ÿ™Ð%Õ&©©T±#±u·|±|Ð2CÕ-DÕ(EÐEÕ	Fñ	P:r   c           	     óŠ  € V P                   '       dÎ   Vf   \        P                  ! RR4       M±V F«  pVR,          p\        V\        P                  4      '       d\   \        P                  ! \        VP                  4      ^8H  ;'       d    VP                  R,          ^8H  RVP                   R24       K‡  \        P                  ! RR\        V4       R24       K­  	  . pV Ff  pVP                  RR p\        P                  ! \        V4      ^8H  RVP                  RR  24       VP                  V^ ,          V^,          34       Kh  	  V P                  W4      w  rVe±   \        V4       F¡  w  rƒVR,          pVR,          VR,          8*  p	V	P                  4       '       g   K9  \        P                  ! V	P                  ^R	7      4      ^ ,          ^ ,          p
WJ,          P                  4       p\        P                  ! RR
V RV R24       K£  	  V P                  VP                  4      p\        V\        P                  4      '       d   \!        RV3.4      pV P#                  WV4      w  rÞV P%                  WÍVP&                  V4      w  ppV P                  P)                  WñP&                  V4      p/ pVP+                  V4       VP+                  V4       \        P,                  P/                  4       '       d4   V P0                  '       g   \2        P4                  ! R4       RV n        VV3# V P7                  VV4      # )aÃ  
Args:
    images (list[Tensor]): images to be processed
    targets (list[dict[str, tensor]]): ground-truth boxes present in the image (optional)

Returns:
    result (list[BoxList] or dict[Tensor]): the output from the model.
        During training, it returns a dict[Tensor] which contains the losses.
        During testing, it returns list[BoxList] contains additional fields
        like `scores`, `labels` and `mask` (for Mask R-CNN models).

NFz0targets should not be none when in training modeÚboxesz:Expected target boxes to be a tensor of shape [N, 4], got Ú.z0Expected target boxes to be of type Tensor, got zJexpecting the last two dimensions of the Tensor to be H and W instead got )ÚdimzLAll bounding boxes should have positive height and width. Found invalid box z for target at index Ú0z=RCNN always returns a (Losses, Detections) tuple in scriptingTéÿÿÿÿéþÿÿÿ)ºNNN:r
   NN)r6   :Nr
   N)r(   r#   Ú_assertÚ
isinstancer$   ÚlenÚshapeÚtypeÚappendr   Ú	enumerateÚanyÚwhereÚtolistr   Útensorsr   r   r   Úimage_sizesÚpostprocessÚupdateÚjitÚis_scriptingr   ÚwarningsÚwarnr)   )r   r,   r-   Útargetr0   Úoriginal_image_sizesÚimgÚvalÚ
target_idxÚdegenerate_boxesÚbb_idxÚdegen_bbÚfeaturesÚ	proposalsÚproposal_lossesr    Údetector_lossesr   s   &&&               r   ÚforwardÚGeneralizedRCNN.forward5   sÎ  € ð" �=�=ˆ=ØŠÜ—’˜eÐ%WÕXã%�FØ" 7�O�EÜ! %¬¯©×6Ò6ÜŸšÜ §¡Ó,°Ñ1×JÐJ°e·k±kÀ"µoÈÑ6JØXÐY^×YdÑYdÐXeÐefÐgöô
 ŸšØ!ØNÌtÐTYË{ÈmÐ[\Ð]öñ &ð 79ÐÛˆCØ—)‘)˜B˜C�.ˆCÜ�MŠMÜ�C“˜A‘Ø\Ð]`×]fÑ]fÐgiÐgjÐ]kÐ\lÐmôð !×'Ñ'¨¨Q­°°QµÐ(8Ö9ñ ð Ÿ.™.¨Ó9‰ˆð ÒÜ&/°Ö&8Ñ"�
Ø˜w��Ø#(¨¥<°5¸µ<Ñ#?Ð Ø#×'Ñ'×)Ô)ä"Ÿ[š[Ð)9×)=Ñ)=À!Ð)=Ó)DÓEÀaÕHÈÕK�FØ,1­M×,@Ñ,@Ó,B�HÜ—M’MØð.Ø.6¨ZÐ7LÈZÈLÐXYð[öñ '9ð —=‘= §¡Ó0ˆÜ�h¤§¡×-Ò-Ü" S¨( OÐ#4Ó5ˆHØ%)§X¡X¨fÀÓ%HÑ"ˆ	Ø&*§n¡n°XÈ&×J\ÑJ\Ð^eÓ&fÑ#ˆ
�OØ—^‘^×/Ñ/Ø×*Ñ*Ð,@ó
ˆ
ð ˆØ�‰�oÔ&Ø�‰�oÔ&ä�9‰9×!Ñ!×#Ò#Ø×#×#Ð#Ü—’Ð]Ô^Ø#'�Ô Ø˜:Ð%Ð%à×%Ñ% f¨jÓ9Ð9r   )r   r   r   r   r   r'   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r#   rE   Úunusedr)   rU   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   r   s   @@r   r   r      sD   ù‡ € ñ
÷!ó !ð  ‡Y�Y×Ñ÷ó ð÷P:÷ P:ò P:r   r   )r[   rG   Úcollectionsr   Útypingr   r   r#   r   Úutilsr   r   r   © r   r   Ú<module>rd      s0   ðñó Ý #ß "ã Ý å (ôv:�b—i‘iö v:r   