Ë
    þÍ:j˜  ã                   óÀ  — d dl mZ d dlmZmZmZmZ d dlZd dlm	Z	 d dlm
Z
 ddlmZ ddlmZ dd	lmZmZmZ dd
lmZ ddlmZmZ g d¢ZdEdededededede	j4                  fd„ZdFdededede	j4                  fd„Z G d„ de	j:                  «      Z G d„ de	j:                  «      Z G d„ de	j:                  «      Z de!eeef      de"e   dee   de#dede fd „Z$d!ed"œZ% G d#„ d$e«      Z& G d%„ d&e«      Z' G d'„ d(e«      Z( G d)„ d*e«      Z) G d+„ d,e«      Z* G d-„ d.e«      Z+ G d/„ d0e«      Z, G d1„ d2e«      Z- G d3„ d4e«      Z. G d5„ d6e«      Z/ e«        ed7e&j`                  f¬8«      dd9d:œdee&   de#dede fd;„«       «       Z1 e«        ed7e'j`                  f¬8«      dd9d:œdee'   de#dede fd<„«       «       Z2 e«        ed7e(j`                  f¬8«      dd9d:œdee(   de#dede fd=„«       «       Z3 e«        ed7e)j`                  f¬8«      dd9d:œdee)   de#dede fd>„«       «       Z4 e«        ed7e*j`                  f¬8«      dd9d:œdee*   de#dede fd?„«       «       Z5 e«        ed7e+j`                  f¬8«      dd9d:œdee+   de#dede fd@„«       «       Z6 e«        ed7e,j`                  f¬8«      dd9d:œdee,   de#dede fdA„«       «       Z7 e«        ed7e-j`                  f¬8«      dd9d:œdee-   de#dede fdB„«       «       Z8 e«        ed7e.j`                  f¬8«      dd9d:œdee.   de#dede fdC„«       «       Z9 e«        ed7e/j`                  f¬8«      dd9d:œdee/   de#dede fdD„«       «       Z:y)Gé    )Úpartial)ÚAnyÚCallableÚOptionalÚUnionN)ÚTensoré   )ÚImageClassification)Ú_log_api_usage_onceé   )Úregister_modelÚWeightsÚWeightsEnum)Ú_IMAGENET_CATEGORIES)Ú_ovewrite_named_paramÚhandle_legacy_interface)ÚResNetÚResNet18_WeightsÚResNet34_WeightsÚResNet50_WeightsÚResNet101_WeightsÚResNet152_WeightsÚResNeXt50_32X4D_WeightsÚResNeXt101_32X8D_WeightsÚResNeXt101_64X4D_WeightsÚWide_ResNet50_2_WeightsÚWide_ResNet101_2_WeightsÚresnet18Úresnet34Úresnet50Ú	resnet101Ú	resnet152Úresnext50_32x4dÚresnext101_32x8dÚresnext101_64x4dÚwide_resnet50_2Úwide_resnet101_2Ú	in_planesÚ
out_planesÚstrideÚgroupsÚdilationÚreturnc           
      ó<   — t        j                  | |d|||d|¬«      S )z3x3 convolution with paddingé   F)Úkernel_sizer*   Úpaddingr+   Úbiasr,   ©ÚnnÚConv2d)r(   r)   r*   r+   r,   s        ún/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torchvision/models/resnet.pyÚconv3x3r7   (   s+   € ä�9‰9ØØØØØØØØô	ð 	ó    c                 ó6   — t        j                  | |d|d¬«      S )z1x1 convolutionr   F)r0   r*   r2   r3   )r(   r)   r*   s      r6   Úconv1x1r:   6   s   € ä�9‰9�Y 
¸À&ÈuÔUÐUr8   c                   ó°   ‡ — e Zd ZU dZeed<   	 	 	 	 	 	 ddedededeej                     ded	ed
edee	dej                  f      ddfˆ fd„Z
dedefd„Zˆ xZS )Ú
BasicBlockr   Ú	expansionNÚinplanesÚplanesr*   Ú
downsampler+   Ú
base_widthr,   Ú
norm_layer.r-   c	                 ó\  •— t         ‰	| �  «        |€t        j                  }|dk7  s|dk7  rt	        d«      ‚|dkD  rt        d«      ‚t        |||«      | _         ||«      | _        t        j                  d¬«      | _
        t        ||«      | _         ||«      | _        || _        || _        y )Nr   é@   z3BasicBlock only supports groups=1 and base_width=64z(Dilation > 1 not supported in BasicBlockT©Úinplace)ÚsuperÚ__init__r4   ÚBatchNorm2dÚ
ValueErrorÚNotImplementedErrorr7   Úconv1Úbn1ÚReLUÚreluÚconv2Úbn2r@   r*   )
Úselfr>   r?   r*   r@   r+   rA   r,   rB   Ú	__class__s
            €r6   rH   zBasicBlock.__init__>   s    ø€ ô 	‰ÑÔØÐÜŸ™ˆJØ�QŠ;˜*¨Ò*ÜÐRÓSÐSØ�aŠ<Ü%Ð&PÓQÐQä˜X v¨vÓ6ˆŒ
Ù˜fÓ%ˆŒÜ—G‘G DÔ)ˆŒ	Ü˜V VÓ,ˆŒ
Ù˜fÓ%ˆŒØ$ˆŒØˆ�r8   Úxc                 ó  — |}| j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }| j
                  �| j                  |«      }||z  }| j                  |«      }|S ©N)rL   rM   rO   rP   rQ   r@   ©rR   rT   ÚidentityÚouts       r6   ÚforwardzBasicBlock.forwardY   s{   € Øˆà�j‰j˜‹mˆØ�h‰h�s‹mˆØ�i‰i˜‹nˆà�j‰j˜‹oˆØ�h‰h�s‹mˆà�?‰?Ð&Ø—‘ qÓ)ˆHàˆx‰ˆØ�i‰i˜‹nˆàˆ
r8   ©r   Nr   rD   r   N©Ú__name__Ú
__module__Ú__qualname__r=   ÚintÚ__annotations__r   r4   ÚModuler   rH   r   rZ   Ú__classcell__©rS   s   @r6   r<   r<   ;   s¬   ø… Ø€IˆsÓð Ø*.ØØØØ9=ñàðð ðð ð	ð
 ˜RŸY™YÑ'ðð ðð ðð ðð ˜X c¨2¯9©9 nÑ5Ñ6ðð 
õð6˜ð  F÷ r8   r<   c                   ó°   ‡ — e Zd ZU dZeed<   	 	 	 	 	 	 ddedededeej                     ded	ed
edee	dej                  f      ddfˆ fd„Z
dedefd„Zˆ xZS )Ú
Bottlenecké   r=   Nr>   r?   r*   r@   r+   rA   r,   rB   .r-   c	                 ó®  •— t         ‰
| �  «        |€t        j                  }t	        ||dz  z  «      |z  }	t        ||	«      | _         ||	«      | _        t        |	|	|||«      | _	         ||	«      | _
        t        |	|| j                  z  «      | _         ||| j                  z  «      | _        t        j                  d¬«      | _        || _        || _        y )Ng      P@TrE   )rG   rH   r4   rI   r`   r:   rL   rM   r7   rP   rQ   r=   Úconv3Úbn3rN   rO   r@   r*   )rR   r>   r?   r*   r@   r+   rA   r,   rB   ÚwidthrS   s             €r6   rH   zBottleneck.__init__u   s¼   ø€ ô 	‰ÑÔØÐÜŸ™ˆJÜ�F˜j¨4Ñ/Ñ0Ó1°FÑ:ˆä˜X uÓ-ˆŒ
Ù˜eÓ$ˆŒÜ˜U E¨6°6¸8ÓDˆŒ
Ù˜eÓ$ˆŒÜ˜U F¨T¯^©^Ñ$;Ó<ˆŒ
Ù˜f t§~¡~Ñ5Ó6ˆŒÜ—G‘G DÔ)ˆŒ	Ø$ˆŒØˆ�r8   rT   c                 ó€  — |}| j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j                  �| j                  |«      }||z  }| j                  |«      }|S rV   )rL   rM   rO   rP   rQ   ri   rj   r@   rW   s       r6   rZ   zBottleneck.forward�   s¢   € Øˆà�j‰j˜‹mˆØ�h‰h�s‹mˆØ�i‰i˜‹nˆà�j‰j˜‹oˆØ�h‰h�s‹mˆØ�i‰i˜‹nˆà�j‰j˜‹oˆØ�h‰h�s‹mˆà�?‰?Ð&Ø—‘ qÓ)ˆHàˆx‰ˆØ�i‰i˜‹nˆàˆ
r8   r[   r\   rd   s   @r6   rf   rf   l   s®   ø… ð €IˆsÓð Ø*.ØØØØ9=ñàðð ðð ð	ð
 ˜RŸY™YÑ'ðð ðð ðð ðð ˜X c¨2¯9©9 nÑ5Ñ6ðð 
õð4˜ð  F÷ r8   rf   c                   ó  ‡ — e Zd Z	 	 	 	 	 	 ddeeeef      dee   dede	dedede
ee	      d	e
ed
ej                  f      ddfˆ fd„Z	 	 ddeeeef      dededede	dej                  fd„Zdedefd„Zdedefd„Zˆ xZS )r   NÚblockÚlayersÚnum_classesÚzero_init_residualr+   Úwidth_per_groupÚreplace_stride_with_dilationrB   .r-   c	                 ó¬  •— t         ‰
| �  «        t        | «       |€t        j                  }|| _        d| _        d| _        |€g d¢}t        |«      dk7  rt        d|› �«      ‚|| _
        || _        t        j                  d| j                  dddd¬	«      | _         || j                  «      | _        t        j                  d
¬«      | _        t        j"                  ddd¬«      | _        | j'                  |d|d   «      | _        | j'                  |d|d   d|d   ¬«      | _        | j'                  |d|d   d|d   ¬«      | _        | j'                  |d|d   d|d   ¬«      | _        t        j0                  d«      | _        t        j4                  d|j6                  z  |«      | _        | j;                  «       D ]È  }	t=        |	t        j                  «      r-t        j>                  jA                  |	jB                  dd¬«       ŒJt=        |	t        j                  t        jD                  f«      sŒut        j>                  jG                  |	jB                  d«       t        j>                  jG                  |	jH                  d«       ŒÊ |rÍ| j;                  «       D ]¹  }	t=        |	tJ        «      rK|	jL                  jB                  �5t        j>                  jG                  |	jL                  jB                  d«       Œ^t=        |	tN        «      sŒo|	jP                  jB                  €Œ†t        j>                  jG                  |	jP                  jB                  d«       Œ» y y )NrD   r   )FFFr/   zFreplace_stride_with_dilation should be None or a 3-element tuple, got é   r	   F)r0   r*   r1   r2   TrE   )r0   r*   r1   r   é€   )r*   Údilateé   i   ©r   r   Úfan_outrO   )ÚmodeÚnonlinearity))rG   rH   r   r4   rI   Ú_norm_layerr>   r,   ÚlenrJ   r+   rA   r5   rL   rM   rN   rO   Ú	MaxPool2dÚmaxpoolÚ_make_layerÚlayer1Úlayer2Úlayer3Úlayer4ÚAdaptiveAvgPool2dÚavgpoolÚLinearr=   ÚfcÚmodulesÚ
isinstanceÚinitÚkaiming_normal_ÚweightÚ	GroupNormÚ	constant_r2   rf   rj   r<   rQ   )rR   rn   ro   rp   rq   r+   rr   rs   rB   ÚmrS   s             €r6   rH   zResNet.__init__§   s§  ø€ ô 	‰ÑÔÜ˜DÔ!ØÐÜŸ™ˆJØ%ˆÔàˆŒØˆŒØ'Ð/ò ,AÐ(ÜÐ+Ó,°Ò1Üð-Ø-IÐ,JðLóð ð ˆŒØ)ˆŒÜ—Y‘Y˜q $§-¡-¸QÀqÐRSÐZ_Ô`ˆŒ
Ù˜dŸm™mÓ,ˆŒÜ—G‘G DÔ)ˆŒ	Ü—|‘|°¸!ÀQÔGˆŒØ×&Ñ& u¨b°&¸±)Ó<ˆŒØ×&Ñ& u¨c°6¸!±9ÀQÐOkÐlmÑOnÐ&ÓoˆŒØ×&Ñ& u¨c°6¸!±9ÀQÐOkÐlmÑOnÐ&ÓoˆŒØ×&Ñ& u¨c°6¸!±9ÀQÐOkÐlmÑOnÐ&ÓoˆŒÜ×+Ñ+¨FÓ3ˆŒÜ—)‘)˜C %§/¡/Ñ1°;Ó?ˆŒà—‘“ò 	-ˆAÜ˜!œRŸY™YÔ'Ü—‘×'Ñ'¨¯©°yÈvÐ'ÕVÜ˜A¤§¡´·±Ð=Õ>Ü—‘×!Ñ! !§(¡(¨AÔ.Ü—‘×!Ñ! !§&¡&¨!Õ,ð	-ñ Ø—\‘\“^ò 7�Ü˜a¤Ô,°·±·±Ð1IÜ—G‘G×%Ñ% a§e¡e§l¡l°AÕ6Ü ¤:Õ.°1·5±5·<±<Ñ3KÜ—G‘G×%Ñ% a§e¡e§l¡l°AÕ6ñ	7ð r8   r?   Úblocksr*   rw   c                 ó´  — | j                   }d }| j                  }|r| xj                  |z  c_        d}|dk7  s| j                  ||j                  z  k7  rKt	        j
                  t        | j                  ||j                  z  |«       |||j                  z  «      «      }g }	|	j                   || j                  |||| j                  | j                  ||«      «       ||j                  z  | _        t        d|«      D ]G  }
|	j                   || j                  || j                  | j                  | j                  |¬«      «       ŒI t	        j
                  |	Ž S )Nr   )r+   rA   r,   rB   )r}   r,   r>   r=   r4   Ú
Sequentialr:   Úappendr+   rA   Úrange)rR   rn   r?   r’   r*   rw   rB   r@   Úprevious_dilationro   Ú_s              r6   r�   zResNet._make_layerá   s0  € ð ×%Ñ%ˆ
Øˆ
Ø ŸM™MÐÙØ�MŠM˜VÑ#�MØˆFØ�QŠ;˜$Ÿ-™-¨6°E·O±OÑ+CÒCÜŸ™Ü˜Ÿ™ v°·±Ñ'?ÀÓHÙ˜6 E§O¡OÑ3Ó4óˆJð
 ˆØ�‰ÙØ—‘˜v v¨z¸4¿;¹;ÈÏÉÐYjÐlvóô	
ð
  §¡Ñ0ˆŒÜ�q˜&Ó!ò 
	ˆAØ�M‰MÙØ—M‘MØØŸ;™;Ø#Ÿ™Ø!Ÿ]™]Ø)ôõ	ð
	ô �}‰}˜fÐ%Ð%r8   rT   c                 ó†  — | j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }t        j                  |d«      }| j                  |«      }|S )Nr   )rL   rM   rO   r€   r‚   rƒ   r„   r…   r‡   ÚtorchÚflattenr‰   ©rR   rT   s     r6   Ú_forward_implzResNet._forward_impl
  s™   € à�J‰J�q‹MˆØ�H‰H�Q‹KˆØ�I‰I�a‹LˆØ�L‰L˜‹Oˆà�K‰K˜‹NˆØ�K‰K˜‹NˆØ�K‰K˜‹NˆØ�K‰K˜‹Nˆà�L‰L˜‹OˆÜ�M‰M˜!˜QÓˆØ�G‰G�A‹Jˆàˆr8   c                 ó$   — | j                  |«      S rV   )r�   rœ   s     r6   rZ   zResNet.forward  s   € Ø×!Ñ! !Ó$Ð$r8   )iè  Fr   rD   NN)r   F)r]   r^   r_   Útyper   r<   rf   Úlistr`   Úboolr   r   r4   rb   rH   r”   r�   r   r�   rZ   rc   rd   s   @r6   r   r   ¦   s$  ø„ ð
  Ø#(ØØ!Ø=AØ9=ñ87à�E˜* jÐ0Ñ1Ñ2ð87ð �S‘	ð87ð ð	87ð
 !ð87ð ð87ð ð87ð '/¨t°D©zÑ&:ð87ð ˜X c¨2¯9©9 nÑ5Ñ6ð87ð 
õ87ð~ Øñ'&à�E˜* jÐ0Ñ1Ñ2ð'&ð ð'&ð ð	'&ð
 ð'&ð ð'&ð 
�‰ó'&ðR˜vð ¨&ó ð$%˜ð % F÷ %r8   r   rn   ro   ÚweightsÚprogressÚkwargsc                 ó²   — |�#t        |dt        |j                  d   «      «       t        | |fi |¤Ž}|�"|j	                  |j                  |d¬«      «       |S )Nrp   Ú
categoriesT)r£   Ú
check_hash)r   r~   Úmetar   Úload_state_dictÚget_state_dict)rn   ro   r¢   r£   r¤   Úmodels         r6   Ú_resnetr¬      s_   € ð ÐÜ˜f m´S¸¿¹ÀlÑ9SÓ5TÔUä�5˜&Ñ+ FÑ+€EàÐØ×Ñ˜g×4Ñ4¸hÐSWÐ4ÓXÔYà€Lr8   ry   )Úmin_sizer¦   c                   óV   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZy)r   z9https://download.pytorch.org/models/resnet18-f37072fd.pthéà   ©Ú	crop_sizei(^² úLhttps://github.com/pytorch/vision/tree/main/references/classification#resnetúImageNet-1Kg�—nƒpQ@g¢E¶óýDV@©zacc@1zacc@5g /Ý$ý?gøSã¥›TF@úXThese weights reproduce closely the results of the paper using a simple training recipe.©Ú
num_paramsÚrecipeÚ_metricsÚ_opsÚ
_file_sizeÚ_docs©ÚurlÚ
transformsr¨   N©	r]   r^   r_   r   r   r
   Ú_COMMON_METAÚIMAGENET1K_V1ÚDEFAULT© r8   r6   r   r   8  óW   „ ÙØGÙÐ.¸#Ô>ð
Øð
à"ØdàØ#Ø#ñ ðð Ø Øsò
ô€Mð$ �Gr8   r   c                   óV   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZy)r   z9https://download.pytorch.org/models/resnet34-b627a593.pthr¯   r°   i(›Lr²   r³   gj¼t“TR@g{®GáÚV@r´   gZd;ßO@gš™™™™ÑT@rµ   r¶   r½   NrÀ   rÄ   r8   r6   r   r   N  rÅ   r8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   z9https://download.pytorch.org/models/resnet50-0676ba61.pthr¯   r°   i(ø…r²   r³   g¸…ëQS@gºI+7W@r´   gB`åÐ"[@gD‹lçûqX@rµ   r¶   r½   z9https://download.pytorch.org/models/resnet50-11ad3fa6.pthéè   ©r±   Úresize_sizezEhttps://github.com/pytorch/vision/issues/3995#issuecomment-1013906621gôýÔxé6T@g²�ï§ÆÛW@gÃõ(\�rX@úþ
                These weights improve upon the results of the original paper by using TorchVision's `new training recipe
                <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_.
            N©
r]   r^   r_   r   r   r
   rÁ   rÂ   ÚIMAGENET1K_V2rÃ   rÄ   r8   r6   r   r   d  s«   „ ÙØGÙÐ.¸#Ô>ð
Øð
à"ØdàØ#Ø#ñ ðð Ø Øsò
ô€Mñ$ ØGÙÐ.¸#È3ÔOð
Øð
à"Ø]àØ#Ø#ñ ðð Øðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   z:https://download.pytorch.org/models/resnet101-63fe2227.pthr¯   r°   i(Ä§r²   r³   g-²�ïWS@gmçû©ñbW@r´   gNbX94@g1¬ZPe@rµ   r¶   r½   z:https://download.pytorch.org/models/resnet101-cd907fc2.pthrÈ   rÉ   ú8https://github.com/pytorch/vision/issues/3995#new-recipegbX9´xT@gR¸…ëñW@g)\�ÂõPe@rË   NrÌ   rÄ   r8   r6   r   r   �  s«   „ ÙØHÙÐ.¸#Ô>ð
Øð
à"ØdàØ#Ø#ñ ðð Ø!Øsò
ô€Mñ$ ØHÙÐ.¸#È3ÔOð
Øð
à"ØPàØ#Ø#ñ ðð Ø ðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   z:https://download.pytorch.org/models/resnet152-394f9c45.pthr¯   r°   i(x–r²   r³   g‡ÙÎ÷“S@gmçû©ñ‚W@r´   gºI+'@gÙÎ÷SãÍl@rµ   r¶   r½   z:https://download.pytorch.org/models/resnet152-f82ba261.pthrÈ   rÉ   rÏ   gV-’T@gã¥›Ä  X@gºI+Ïl@rË   NrÌ   rÄ   r8   r6   r   r   º  s«   „ ÙØHÙÐ.¸#Ô>ð
Øð
à"ØdàØ#Ø#ñ ðð Ø!Øsò
ô€Mñ$ ØHÙÐ.¸#È3ÔOð
Øð
à"ØPàØ#Ø#ñ ðð Ø!ðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   z@https://download.pytorch.org/models/resnext50_32x4d-7cdf4587.pthr¯   r°   i(é}úMhttps://github.com/pytorch/vision/tree/main/references/classification#resnextr³   gd;ßO�gS@gé&1¬lW@r´   gìQ¸…ë@gÑ"Ûù~òW@rµ   r¶   r½   z@https://download.pytorch.org/models/resnext50_32x4d-1a0047aa.pthrÈ   rÉ   rÏ   gé&1¬LT@gö(\�ÂÕW@gZd;ßOõW@rË   NrÌ   rÄ   r8   r6   r   r   å  s«   „ ÙØNÙÐ.¸#Ô>ð
Øð
à"ØeàØ#Ø#ñ ðð Ø Øsò
ô€Mñ$ ØNÙÐ.¸#È3ÔOð
Øð
à"ØPàØ#Ø#ñ ðð Ø ðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   zAhttps://download.pytorch.org/models/resnext101_32x8d-8ba56ff5.pthr¯   r°   i(ÙJrÒ   r³   g‡ÙÎ÷ÓS@g‹lçû©¡W@r´   gD‹lçûi0@gL7‰A`9u@rµ   r¶   r½   zAhttps://download.pytorch.org/models/resnext101_32x8d-110c445d.pthrÈ   rÉ   úDhttps://github.com/pytorch/vision/issues/3995#new-recipe-with-fixresgL7‰A`µT@g;ßO�—X@gTã¥›Ä:u@rË   NrÌ   rÄ   r8   r6   r   r     s«   „ ÙØOÙÐ.¸#Ô>ð
Øð
à"ØeàØ#Ø#ñ ðð Ø!Øsò
ô€Mñ$ ØOÙÐ.¸#È3ÔOð
Øð
à"Ø\àØ#Ø#ñ ðð Ø!ðò
ô€Mð* �Gr8   r   c                   óX   — e Zd Z ed eedd¬«      i e¥ddddd	d
œiddddœ¥¬«      ZeZy)r   zAhttps://download.pytorch.org/models/resnext101_64x4d-173b62eb.pthr¯   rÈ   rÉ   i(mùz+https://github.com/pytorch/vision/pull/5935r³   g9´Èv¾ÏT@g“VX@r´   gìQ¸…ë.@g+‡õs@zé
                These weights were trained from scratch by using TorchVision's `new training recipe
                <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_.
            r¶   r½   NrÀ   rÄ   r8   r6   r   r   ;  s[   „ ÙØOÙÐ.¸#È3ÔOð
Øð
à"ØCàØ#Ø#ñ ðð Ø!ðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   z@https://download.pytorch.org/models/wide_resnet50_2-95faca4d.pthr¯   r°   i(ú:https://github.com/pytorch/vision/pull/912#issue-445437439r³   gË¡E¶ó�S@g/Ý$�…W@r´   g²�ï§ÆË&@g
×£p=z`@rµ   r¶   r½   z@https://download.pytorch.org/models/wide_resnet50_2-9ba9bcbe.pthrÈ   rÉ   rÔ   gJ+‡fT@g�—nƒðW@gD‹lçûqp@rË   NrÌ   rÄ   r8   r6   r   r   T  s«   „ ÙØNÙÐ.¸#Ô>ð
Øð
à"ØRàØ#Ø#ñ ðð Ø Øsò
ô€Mñ$ ØNÙÐ.¸#È3ÔOð
Øð
à"Ø\àØ#Ø#ñ ðð Ø!ðò
ô€Mð* �Gr8   r   c                   óž   — e Zd Z ed eed¬«      i e¥dddddd	œid
dddœ¥¬«      Z ed eedd¬«      i e¥dddddd	œid
dddœ¥¬«      ZeZ	y)r   zAhttps://download.pytorch.org/models/wide_resnet101_2-32ee1156.pthr¯   r°   i(#�r×   r³   gƒÀÊ¡E¶S@gV-’W@r´   gTã¥›ÄÀ6@gé&1¬\n@rµ   r¶   r½   zAhttps://download.pytorch.org/models/wide_resnet101_2-d733dc28.pthrÈ   rÉ   rÏ   gq=
×£ T@gáz®GX@gË¡E¶óK~@rË   NrÌ   rÄ   r8   r6   r   r     s«   „ ÙØOÙÐ.¸#Ô>ð
Øð
à#ØRàØ#Ø#ñ ðð Ø!Øsò
ô€Mñ$ ØOÙÐ.¸#È3ÔOð
Øð
à#ØPàØ#Ø#ñ ðð Ø!ðò
ô€Mð* �Gr8   r   Ú
pretrained)r¢   T)r¢   r£   c                 óV   — t         j                  | «      } t        t        g d¢| |fi |¤ŽS )ap  ResNet-18 from `Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385>`__.

    Args:
        weights (:class:`~torchvision.models.ResNet18_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet18_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet18_Weights
        :members:
    )r	   r	   r	   r	   )r   Úverifyr¬   r<   ©r¢   r£   r¤   s      r6   r   r   ª  ó*   € ô* ×%Ñ% gÓ.€Gä”:š|¨W°hÑIÀ&ÑIÐIr8   c                 óV   — t         j                  | «      } t        t        g d¢| |fi |¤ŽS )ap  ResNet-34 from `Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385>`__.

    Args:
        weights (:class:`~torchvision.models.ResNet34_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet34_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet34_Weights
        :members:
    ©r/   rg   é   r/   )r   rÛ   r¬   r<   rÜ   s      r6   r   r   Ä  rÝ   r8   c                 óV   — t         j                  | «      } t        t        g d¢| |fi |¤ŽS )aÏ  ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet50_Weights
        :members:
    rß   )r   rÛ   r¬   rf   rÜ   s      r6   r    r    Þ  s*   € ô6 ×%Ñ% gÓ.€Gä”:š|¨W°hÑIÀ&ÑIÐIr8   c                 óV   — t         j                  | «      } t        t        g d¢| |fi |¤ŽS )aÓ  ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet101_Weights
        :members:
    ©r/   rg   é   r/   )r   rÛ   r¬   rf   rÜ   s      r6   r!   r!   þ  ó*   € ô6  ×&Ñ& wÓ/€Gä”:š}¨g°xÑJÀ6ÑJÐJr8   c                 óV   — t         j                  | «      } t        t        g d¢| |fi |¤ŽS )aÓ  ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet152_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet152_Weights
        :members:
    )r/   é   é$   r/   )r   rÛ   r¬   rf   rÜ   s      r6   r"   r"     rå   r8   c                 óŠ   — t         j                  | «      } t        |dd«       t        |dd«       t        t        g d¢| |fi |¤ŽS )a£  ResNeXt-50 32x4d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt50_32X4D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNext50_32X4D_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights
        :members:
    r+   é    rr   rg   rß   )r   rÛ   r   r¬   rf   rÜ   s      r6   r#   r#   >  sC   € ô. &×,Ñ,¨WÓ5€Gä˜& (¨BÔ/Ü˜&Ð"3°QÔ7Ü”:š|¨W°hÑIÀ&ÑIÐIr8   c                 óŠ   — t         j                  | «      } t        |dd«       t        |dd«       t        t        g d¢| |fi |¤ŽS )a§  ResNeXt-101 32x8d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt101_32X8D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNeXt101_32X8D_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights
        :members:
    r+   rê   rr   rç   rã   )r   rÛ   r   r¬   rf   rÜ   s      r6   r$   r$   \  óC   € ô. '×-Ñ-¨gÓ6€Gä˜& (¨BÔ/Ü˜&Ð"3°QÔ7Ü”:š}¨g°xÑJÀ6ÑJÐJr8   c                 óŠ   — t         j                  | «      } t        |dd«       t        |dd«       t        t        g d¢| |fi |¤ŽS )a§  ResNeXt-101 64x4d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt101_64X4D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNeXt101_64X4D_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt101_64X4D_Weights
        :members:
    r+   rD   rr   rg   rã   )r   rÛ   r   r¬   rf   rÜ   s      r6   r%   r%   z  rì   r8   c                 óp   — t         j                  | «      } t        |dd«       t        t        g d¢| |fi |¤ŽS )a¥  Wide ResNet-50-2 model from
    `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

    The model is the same as ResNet except for the bottleneck number of channels
    which is twice larger in every block. The number of channels in outer 1x1
    convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
    channels, and in Wide ResNet-50-2 has 2048-1024-2048.

    Args:
        weights (:class:`~torchvision.models.Wide_ResNet50_2_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.Wide_ResNet50_2_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.Wide_ResNet50_2_Weights
        :members:
    rr   rv   rß   )r   rÛ   r   r¬   rf   rÜ   s      r6   r&   r&   ˜  s7   € ô8 &×,Ñ,¨WÓ5€Gä˜&Ð"3°VÔ<Ü”:š|¨W°hÑIÀ&ÑIÐIr8   c                 óp   — t         j                  | «      } t        |dd«       t        t        g d¢| |fi |¤ŽS )a«  Wide ResNet-101-2 model from
    `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

    The model is the same as ResNet except for the bottleneck number of channels
    which is twice larger in every block. The number of channels in outer 1x1
    convolutions is the same, e.g. last block in ResNet-101 has 2048-512-2048
    channels, and in Wide ResNet-101-2 has 2048-1024-2048.

    Args:
        weights (:class:`~torchvision.models.Wide_ResNet101_2_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.Wide_ResNet101_2_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.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.Wide_ResNet101_2_Weights
        :members:
    rr   rv   rã   )r   rÛ   r   r¬   rf   rÜ   s      r6   r'   r'   º  s7   € ô8 '×-Ñ-¨gÓ6€Gä˜&Ð"3°VÔ<Ü”:š}¨g°xÑJÀ6ÑJÐJr8   )r   r   r   )r   );Ú	functoolsr   Útypingr   r   r   r   rš   Útorch.nnr4   r   Útransforms._presetsr
   Úutilsr   Ú_apir   r   r   Ú_metar   Ú_utilsr   r   Ú__all__r`   r5   r7   r:   rb   r<   rf   r   rŸ   r    r¡   r¬   rÁ   r   r   r   r   r   r   r   r   r   r   rÂ   r   r   r    r!   r"   r#   r$   r%   r&   r'   rÄ   r8   r6   ú<module>rù      st  ðÝ ß 1Ó 1ã Ý Ý å 5Ý 'ß 6Ñ 6Ý 'ß Bò€ñ2�sð ¨ð °Sð Àcð ÐY\ð Ðeg×enÑenó ñV�sð V¨ð V°Sð VÀÇÁó Vô
.�—‘ô .ôb7�—‘ô 7ôtw%ˆR�Y‰Yô w%ðtØ��j *Ð,Ñ-Ñ.ðà�‰Iðð �kÑ"ðð ð	ð
 ðð óð& Ø&ñ€ô�{ô ô,�{ô ô,(�{ô (ôV(˜ô (ôV(˜ô (ôV(˜kô (ôV(˜{ô (ôV˜{ô ô2(˜kô (ôV(˜{ô (ñV ÓÙ ,Ð0@×0NÑ0NÐ!OÔPØ6:ÈTò J˜Ð"2Ñ3ð JÀdð JÐ]`ð JÐekò Jó Qó ðJñ0 ÓÙ ,Ð0@×0NÑ0NÐ!OÔPØ6:ÈTò J˜Ð"2Ñ3ð JÀdð JÐ]`ð JÐekò Jó Qó ðJñ0 ÓÙ ,Ð0@×0NÑ0NÐ!OÔPØ6:ÈTò J˜Ð"2Ñ3ð JÀdð JÐ]`ð JÐekò Jó Qó ðJñ< ÓÙ ,Ð0A×0OÑ0OÐ!PÔQØ8<Ètò K˜(Ð#4Ñ5ð KÈð KÐ_bð KÐgmò Kó Ró ðKñ< ÓÙ ,Ð0A×0OÑ0OÐ!PÔQØ8<Ètò K˜(Ð#4Ñ5ð KÈð KÐ_bð KÐgmò Kó Ró ðKñ< ÓÙ ,Ð0G×0UÑ0UÐ!VÔWà48È4òJØÐ0Ñ1ðJØDHðJØ[^ðJàòJó Xó ðJñ8 ÓÙ ,Ð0H×0VÑ0VÐ!WÔXà59ÈDòKØÐ1Ñ2ðKØEIðKØ\_ðKàòKó Yó ðKñ8 ÓÙ ,Ð0H×0VÑ0VÐ!WÔXà59ÈDòKØÐ1Ñ2ðKØEIðKØ\_ðKàòKó Yó ðKñ8 ÓÙ ,Ð0G×0UÑ0UÐ!VÔWà48È4òJØÐ0Ñ1ðJØDHðJØ[^ðJàòJó Xó ðJñ@ ÓÙ ,Ð0H×0VÑ0VÐ!WÔXà59ÈDòKØÐ1Ñ2ðKØEIðKØ\_ðKàòKó Yó ñKr8   