ó
    Eñi#  ã                   ó¨  • S SK Jr  S SKJrJr  S SKJr  SSKJr  SSK	J
r
JrJr  SSKJr  SS	KJrJrJr  SS
KJrJrJrJrJr  SSKJr  / SQr " S S\5      r " S S\R8                  5      r\SSS.r " S S\5      r " S S\5      r S\S\!S\\"   S\4S jr#\
" 5       \" S\RH                  4S\RJ                  4S 9S!S"S!S!\RJ                  S#.S$\\   S%\"S\\!   S&\\"   S'\\   S(\S\4S) jj5       5       r&\
" 5       \" S\ RH                  4S\RJ                  4S 9S!S"S!S!\RJ                  S#.S$\\    S%\"S\\!   S&\\"   S'\\   S(\S\4S* jj5       5       r'g!)+é    )Úpartial)ÚAnyÚOptional)Únné   )ÚSemanticSegmentationé   )Úregister_modelÚWeightsÚWeightsEnum)Ú_VOC_CATEGORIES)Ú_ovewrite_value_paramÚhandle_legacy_interfaceÚIntermediateLayerGetter)ÚResNetÚ	resnet101ÚResNet101_WeightsÚresnet50ÚResNet50_Weightsé   )Ú_SimpleSegmentationModel)ÚFCNÚFCN_ResNet50_WeightsÚFCN_ResNet101_WeightsÚfcn_resnet50Úfcn_resnet101c                   ó   • \ rS rSrSrSrg)r   é   a[  
Implements FCN model from
`"Fully Convolutional Networks for Semantic Segmentation"
<https://arxiv.org/abs/1411.4038>`_.

Args:
    backbone (nn.Module): the network used to compute the features for the model.
        The backbone should return an OrderedDict[Tensor], with the key being
        "out" for the last feature map used, and "aux" if an auxiliary classifier
        is used.
    classifier (nn.Module): module that takes the "out" element returned from
        the backbone and returns a dense prediction.
    aux_classifier (nn.Module, optional): auxiliary classifier used during training
© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú`/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/models/segmentation/fcn.pyr   r      s   † ñò 	r&   r   c                   ó8   ^ • \ rS rSrS\S\SS4U 4S jjrSrU =r$ )ÚFCNHeadé$   Úin_channelsÚchannelsÚreturnNc           	      ó  >• US-  n[         R                  " XSSSS9[         R                  " U5      [         R                  " 5       [         R                  " S5      [         R                  " X2S5      /n[
        TU ]  " U6   g )Né   r   r   F)ÚpaddingÚbiasgš™™™™™¹?)r   ÚConv2dÚBatchNorm2dÚReLUÚDropoutÚsuperÚ__init__)Úselfr+   r,   Úinter_channelsÚlayersÚ	__class__s        €r'   r7   ÚFCNHead.__init__%   sc   ø€ Ø$¨Ñ)ˆä�IŠI�k°1¸aÀeÑLÜ�NŠN˜>Ó*Ü�GŠG‹IÜ�JŠJ�s‹OÜ�IŠI�n°Ó2ð
ˆô 	‰Ò˜&Ò!r&   r   )r    r!   r"   r#   Úintr7   r%   Ú__classcell__)r;   s   @r'   r)   r)   $   s"   ø† ð
" Cð 
"°3ð 
"¸4÷ 
"õ 
"r&   r)   )r   r   zŽ
        These weights were trained on a subset of COCO, using only the 20 categories that are present in the Pascal VOC
        dataset.
    )Ú
categoriesÚmin_sizeÚ_docsc                   óP   • \ rS rSr\" S\" \SS90 \ESSSSS	S
.0SSS.ES9r\r	Sr
g)r   é<   zBhttps://download.pytorch.org/models/fcn_resnet50_coco-1167a1af.pthé  ©Úresize_sizeijùzPhttps://github.com/pytorch/vision/tree/main/references/segmentation#fcn_resnet50úCOCO-val2017-VOC-labelsg     @N@gš™™™™ÙV@©ÚmiouÚ	pixel_accgmçû©ñc@g?5^ºIà`@©Ú
num_paramsÚrecipeÚ_metricsÚ_opsÚ
_file_size©ÚurlÚ
transformsÚmetar   N©r    r!   r"   r#   r   r   r   Ú_COMMON_METAÚCOCO_WITH_VOC_LABELS_V1ÚDEFAULTr%   r   r&   r'   r   r   <   sU   † Ù%ØPÙÐ/¸SÑAð
Øð
à"Øhà)Ø Ø!%ñ,ðð Ø!ò
ñÐð" &ƒGr&   r   c                   óP   • \ rS rSr\" S\" \SS90 \ESSSSS	S
.0SSS.ES9r\r	Sr
g)r   éQ   zChttps://download.pytorch.org/models/fcn_resnet101_coco-7ecb50ca.pthrD   rE   ijÅ<zWhttps://github.com/pytorch/vision/tree/main/references/segmentation#deeplabv3_resnet101rG   gš™™™™ÙO@gš™™™™ùV@rH   gV-²�m@g˜nƒÀöi@rK   rQ   r   NrU   r   r&   r'   r   r   Q   sU   † Ù%ØQÙÐ/¸SÑAð
Øð
à"Øoà)Ø Ø!%ñ,ðð Ø!ò
ñÐð" &ƒGr&   r   ÚbackboneÚnum_classesÚauxr-   c                 óŽ   • SS0nU(       a  SUS'   [        XS9n U(       a  [        SU5      OS n[        SU5      n[        XU5      $ )NÚlayer4Úoutr]   Úlayer3)Úreturn_layersi   i   )r   r)   r   )r[   r\   r]   rb   Úaux_classifierÚ
classifiers         r'   Ú_fcn_resnetre   f   sN   € ð
 ˜uÐ%€MÞ
Ø"'ˆ�hÑÜ& xÑM€Hæ36”W˜T ;Ô/¸D€NÜ˜˜{Ó+€JÜˆx ^Ó4Ð4r&   Ú
pretrainedÚpretrained_backbone)ÚweightsÚweights_backboneNT)rh   Úprogressr\   Úaux_lossri   rh   rj   rk   ri   Úkwargsc                 óF  • [         R                  U 5      n [        R                  " U5      nU b3  Sn[        SU[	        U R
                  S   5      5      n[        SUS5      nOUc  Sn[        U/ SQS9n[        XbU5      nU b  UR                  U R                  USS	95        U$ )
a  Fully-Convolutional Network model with a ResNet-50 backbone from the `Fully Convolutional
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.

.. betastatus:: segmentation module

Args:
    weights (:class:`~torchvision.models.segmentation.FCN_ResNet50_Weights`, optional): The
        pretrained weights to use. See
        :class:`~torchvision.models.segmentation.FCN_ResNet50_Weights` below for
        more details, and possible values. By default, no pre-trained
        weights are used.
    progress (bool, optional): If True, displays a progress bar of the
        download to stderr. Default is True.
    num_classes (int, optional): number of output classes of the model (including the background).
    aux_loss (bool, optional): If True, it uses an auxiliary loss.
    weights_backbone (:class:`~torchvision.models.ResNet50_Weights`, optional): The pretrained
        weights for the backbone.
    **kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
        base class. Please refer to the `source code
        <https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
        for more details about this class.

.. autoclass:: torchvision.models.segmentation.FCN_ResNet50_Weights
    :members:
Nr\   r?   rk   Té   ©FTT©rh   Úreplace_stride_with_dilation©rj   Ú
check_hash)
r   Úverifyr   r   ÚlenrT   r   re   Úload_state_dictÚget_state_dict©rh   rj   r\   rk   ri   rl   r[   Úmodels           r'   r   r   u   s­   € ôP #×)Ñ)¨'Ó2€GÜ'×.Ò.Ð/?Ó@ÐàÑØÐÜ+¨M¸;ÌÈGÏLÉLÐYeÑLfÓHgÓhˆÜ(¨°X¸tÓD‰Ø	Ñ	ØˆäÐ 0ÒObÑc€HÜ˜¨xÓ8€EàÑØ×Ñ˜g×4Ñ4¸hÐSWÐ4ÐXÔYà€Lr&   c                 óF  • [         R                  U 5      n [        R                  " U5      nU b3  Sn[        SU[	        U R
                  S   5      5      n[        SUS5      nOUc  Sn[        U/ SQS9n[        XbU5      nU b  UR                  U R                  USS	95        U$ )
a  Fully-Convolutional Network model with a ResNet-101 backbone from the `Fully Convolutional
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.

.. betastatus:: segmentation module

Args:
    weights (:class:`~torchvision.models.segmentation.FCN_ResNet101_Weights`, optional): The
        pretrained weights to use. See
        :class:`~torchvision.models.segmentation.FCN_ResNet101_Weights` below for
        more details, and possible values. By default, no pre-trained
        weights are used.
    progress (bool, optional): If True, displays a progress bar of the
        download to stderr. Default is True.
    num_classes (int, optional): number of output classes of the model (including the background).
    aux_loss (bool, optional): If True, it uses an auxiliary loss.
    weights_backbone (:class:`~torchvision.models.ResNet101_Weights`, optional): The pretrained
        weights for the backbone.
    **kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
        base class. Please refer to the `source code
        <https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
        for more details about this class.

.. autoclass:: torchvision.models.segmentation.FCN_ResNet101_Weights
    :members:
Nr\   r?   rk   Trn   ro   rp   rr   )
r   rt   r   r   ru   rT   r   re   rv   rw   rx   s           r'   r   r   °   s­   € ôP $×*Ñ*¨7Ó3€GÜ(×/Ò/Ð0@ÓAÐàÑØÐÜ+¨M¸;ÌÈGÏLÉLÐYeÑLfÓHgÓhˆÜ(¨°X¸tÓD‰Ø	Ñ	ØˆäÐ!1ÒPcÑd€HÜ˜¨xÓ8€EàÑØ×Ñ˜g×4Ñ4¸hÐSWÐ4ÐXÔYà€Lr&   )(Ú	functoolsr   Útypingr   r   Útorchr   Útransforms._presetsr   Ú_apir
   r   r   Ú_metar   Ú_utilsr   r   r   Úresnetr   r   r   r   r   r   Ú__all__r   Ú
Sequentialr)   rV   r   r   r=   Úboolre   rW   ÚIMAGENET1K_V1r   r   r   r&   r'   Ú<module>r‡      s
  ðÝ ß  å å 7ß 7Ñ 7Ý #ß \Ñ \ß UÕ UÝ ,ò d€ô	Ð
"ô 	ô&"ˆb�m‰mô "ð "Øðñ€ô&˜;ô &ô*&˜Kô &ð*5Øð5àð5ð 
�$‰ð5ð 	ô	5ñ ÓÙØÐ/×GÑGÐHØ+Ð-=×-KÑ-KÐLñð /3ØØ!%Ø#Ø3C×3QÑ3Qò3àÐ*Ñ+ð3ð ð3ð ˜#‘ð	3ð
 �t‰nð3ð Ð/Ñ0ð3ð ð3ð 	ô3ó	ó ð
3ñl ÓÙØÐ0×HÑHÐIØ+Ð->×-LÑ-LÐMñð 04ØØ!%Ø#Ø4E×4SÑ4Sò3àÐ+Ñ,ð3ð ð3ð ˜#‘ð	3ð
 �t‰nð3ð Ð0Ñ1ð3ð ð3ð 	ô3ó	ó ñ
3r&   