U
    ­Ê¹jR¨  ã                   @   s  U d dl Z d dlZd dlmZ d dlmZ d dlmZmZm	Z	m
Z
mZmZmZmZ d dlZd dlmZmZ d dlmZ ddlmZmZ dd	lmZ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$m%Z% dddddddddddddddddd d!d"d#d$d%gZ&eG d&d'„ d'ƒƒZ'G d(d)„ d)e'ƒZ(G d*d+„ d+e'ƒZ)G d,d-„ d-ej*ƒZ+G d.d/„ d/ej*ƒZ,G d0d„ dej*ƒZ-eee(e)f  e.ee/ ee e0ee-d1œd2d3„Z1e2eeeee(e)f  ee/ f d4œd5d6„Z3d7e!iZ4e	e2ef e5d8< e4d9d:d;œ–Z6e4d<d=d;œ–Z7G d>d„ deƒZ8G d?d„ deƒZ9G d@d„ deƒZ:G dAd„ deƒZ;G dBd„ deƒZ<G dCd„ deƒZ=G dDd„ deƒZ>G dEd„ deƒZ?G dFd„ deƒZ@G dGd„ deƒZAG dHd„ deƒZBeƒ e%dIe8jCfdJ�ddKdLœee8 e0ee-dMœdNd„ƒƒZDeƒ e%dIe9jCfdJ�ddKdLœee9 e0ee-dMœdOd„ƒƒZEeƒ e%dIe:jCfdJ�ddKdLœee: e0ee-dMœdPd„ƒƒZFeƒ e%dIe;jCfdJ�ddKdLœee; e0ee-dMœdQd„ƒƒZGeƒ e%dIe<jCfdJ�ddKdLœee< e0ee-dMœdRd„ƒƒZHeƒ e%dIe=jCfdJ�ddKdLœee= e0ee-dMœdSd „ƒƒZIeƒ e%dIe>jCfdJ�ddKdLœee> e0ee-dMœdTd!„ƒƒZJeƒ e%dIe?jCfdJ�ddKdLœee? e0ee-dMœdUd"„ƒƒZKeƒ e%dIe@jCfdJ�ddKdLœee@ e0ee-dMœdVd#„ƒƒZLeƒ e%dIeAjCfdJ�ddKdLœeeA e0ee-dMœdWd$„ƒƒZMeƒ e%dIeBjCfdJ�ddKdLœeeB e0ee-dMœdXd%„ƒƒZNdS )Yé    N)Ú	dataclass)Úpartial)ÚAnyÚCallableÚDictÚListÚOptionalÚSequenceÚTupleÚUnion)ÚnnÚTensor)ÚStochasticDepthé   )ÚConv2dNormActivationÚSqueezeExcitation)ÚImageClassificationÚInterpolationMode)Ú_log_api_usage_onceé   )Úregister_modelÚWeightsÚWeightsEnum)Ú_IMAGENET_CATEGORIES)Ú_make_divisibleÚ_ovewrite_named_paramÚhandle_legacy_interfaceÚEfficientNetÚEfficientNet_B0_WeightsÚEfficientNet_B1_WeightsÚEfficientNet_B2_WeightsÚEfficientNet_B3_WeightsÚEfficientNet_B4_WeightsÚEfficientNet_B5_WeightsÚEfficientNet_B6_WeightsÚEfficientNet_B7_WeightsÚEfficientNet_V2_S_WeightsÚEfficientNet_V2_M_WeightsÚEfficientNet_V2_L_WeightsÚefficientnet_b0Úefficientnet_b1Úefficientnet_b2Úefficientnet_b3Úefficientnet_b4Úefficientnet_b5Úefficientnet_b6Úefficientnet_b7Úefficientnet_v2_sÚefficientnet_v2_mÚefficientnet_v2_lc                   @   sn   e Zd ZU eed< eed< eed< eed< eed< eed< edejf ed< e	deee
e ed
œdd„ƒZd	S )Ú_MBConvConfigÚexpand_ratioÚkernelÚstrideÚinput_channelsÚout_channelsÚ
num_layers.ÚblockN)ÚchannelsÚ
width_multÚ	min_valueÚreturnc                 C   s   t | | d|ƒS )Né   )r   )r<   r=   r>   © rA   ú^/var/www/html/bwave/python/venv/lib/python3.8/site-packages/torchvision/models/efficientnet.pyÚadjust_channels8   s    z_MBConvConfig.adjust_channels)N)Ú__name__Ú
__module__Ú__qualname__ÚfloatÚ__annotations__Úintr   r   ÚModuleÚstaticmethodr   rC   rA   rA   rA   rB   r4   .   s   
r4   c                       sX   e Zd Zd
eeeeeeeeeedejf  ddœ
‡ fdd„Z	e
eedœdd	„ƒZ‡  ZS )ÚMBConvConfigç      ð?N.)
r5   r6   r7   r8   r9   r:   r=   Ú
depth_multr;   r?   c
           
   	      sL   |   ||¡}|   ||¡}|  ||¡}|	d kr0t}	tƒ  |||||||	¡ d S ©N)rC   Úadjust_depthÚMBConvÚsuperÚ__init__)
Úselfr5   r6   r7   r8   r9   r:   r=   rN   r;   ©Ú	__class__rA   rB   rS   ?   s    zMBConvConfig.__init__©r:   rN   c                 C   s   t t | | ¡ƒS rO   )rI   ÚmathÚceilrW   rA   rA   rB   rP   R   s    zMBConvConfig.adjust_depth)rM   rM   N)rD   rE   rF   rG   rI   r   r   r   rJ   rS   rK   rP   Ú__classcell__rA   rA   rU   rB   rL   =   s"   
   öõrL   c                       s@   e Zd Zdeeeeeeeedejf  ddœ‡ fdd„Z	‡  Z
S )ÚFusedMBConvConfigN.)r5   r6   r7   r8   r9   r:   r;   r?   c              	      s(   |d krt }tƒ  |||||||¡ d S rO   )ÚFusedMBConvrR   rS   )rT   r5   r6   r7   r8   r9   r:   r;   rU   rA   rB   rS   Y   s    
zFusedMBConvConfig.__init__)N)rD   rE   rF   rG   rI   r   r   r   rJ   rS   rZ   rA   rA   rU   rB   r[   W   s   
 ø÷r[   c                       sR   e Zd Zefeeedejf edejf ddœ‡ fdd„Z	e
e
dœdd„Z‡  ZS )	rQ   .N)ÚcnfÚstochastic_depth_probÚ
norm_layerÚse_layerr?   c           	         s  t ƒ  ¡  d|j  kr dks*n tdƒ‚|jdko>|j|jk| _g }tj}| 	|j|j
¡}||jkr€| t|j|d||d�¡ | t|||j|j|||d�¡ td|jd ƒ}| |||ttjdd�d	�¡ | t||jd|d d�¡ tj|Ž | _t|d
ƒ| _|j| _d S )Nr   r   úillegal stride value©Úkernel_sizer_   Úactivation_layer)rc   r7   Úgroupsr_   rd   é   T)Úinplace)Z
activationÚrow)rR   rS   r7   Ú
ValueErrorr8   r9   Úuse_res_connectr   ÚSiLUrC   r5   Úappendr   r6   Úmaxr   Ú
Sequentialr;   r   Ústochastic_depth)	rT   r]   r^   r_   r`   Úlayersrd   Úexpanded_channelsZsqueeze_channelsrU   rA   rB   rS   i   sT    

ûÿùÿ    ÿÿzMBConv.__init__©Úinputr?   c                 C   s&   |   |¡}| jr"|  |¡}||7 }|S rO   ©r;   rj   ro   ©rT   rs   ÚresultrA   rA   rB   Úforward£   s
    

zMBConv.forward)rD   rE   rF   r   rL   rG   r   r   rJ   rS   r   rw   rZ   rA   rA   rU   rB   rQ   h   s   ûú:rQ   c                       sB   e Zd Zeeedejf ddœ‡ fdd„Ze	e	dœdd„Z
‡  ZS )	r\   .N)r]   r^   r_   r?   c              
      sè   t ƒ  ¡  d|j  kr dks*n tdƒ‚|jdko>|j|jk| _g }tj}| 	|j|j
¡}||jkr¢| t|j||j|j||d�¡ | t||jd|d d�¡ n"| t|j|j|j|j||d�¡ tj|Ž | _t|dƒ| _|j| _d S )Nr   r   ra   ©rc   r7   r_   rd   rb   rh   )rR   rS   r7   ri   r8   r9   rj   r   rk   rC   r5   rl   r   r6   rn   r;   r   ro   )rT   r]   r^   r_   rp   rd   rq   rU   rA   rB   rS   ¬   sP    

úÿ    ÿÿúÿzFusedMBConv.__init__rr   c                 C   s&   |   |¡}| jr"|  |¡}||7 }|S rO   rt   ru   rA   rA   rB   rw   à   s
    

zFusedMBConv.forward)rD   rE   rF   r[   rG   r   r   rJ   rS   r   rw   rZ   rA   rA   rU   rB   r\   «   s   û4r\   c                	       sn   e Zd Zdeeeef  eeee	e
dejf  e	e ddœ‡ fdd„Zeedœd	d
„Zeedœdd„Z‡  ZS )r   çš™™™™™É?éè  N.)Úinverted_residual_settingÚdropoutr^   Únum_classesr_   Úlast_channelr?   c              
      s<  t ƒ  ¡  t| ƒ |s tdƒ‚n$t|tƒr<tdd„ |D ƒƒsDtdƒ‚|dkrRtj	}g }|d j
}| td|dd|tjd	�¡ td
d„ |D ƒƒ}	d}
|D ]p}g }t|jƒD ]L}t |¡}|rÈ|j|_
d|_|t|
ƒ |	 }| | |||¡¡ |
d7 }
q¨| tj|Ž ¡ q–|d j}|dk	�r |nd| }| t||d|tjd�¡ tj|Ž | _t d¡| _t tj|dd�t ||¡¡| _|  ¡ D ]´}t|tjƒ�rÂtjj |j!dd� |j"dk	�r4tj #|j"¡ nrt|tj	tj$fƒ�rôtj %|j!¡ tj #|j"¡ n@t|tjƒ�r‚dt& '|j(¡ }tj )|j!| |¡ tj #|j"¡ �q‚dS )a  
        EfficientNet V1 and V2 main class

        Args:
            inverted_residual_setting (Sequence[Union[MBConvConfig, FusedMBConvConfig]]): Network structure
            dropout (float): The droupout probability
            stochastic_depth_prob (float): The stochastic depth probability
            num_classes (int): Number of classes
            norm_layer (Optional[Callable[..., nn.Module]]): Module specifying the normalization layer to use
            last_channel (int): The number of channels on the penultimate layer
        z1The inverted_residual_setting should not be emptyc                 S   s   g | ]}t |tƒ‘qS rA   )Ú
isinstancer4   )Ú.0ÚsrA   rA   rB   Ú
<listcomp>  s     z)EfficientNet.__init__.<locals>.<listcomp>z:The inverted_residual_setting should be List[MBConvConfig]Nr   é   r   rx   c                 s   s   | ]}|j V  qd S rO   )r:   )r€   r]   rA   rA   rB   Ú	<genexpr>  s     z(EfficientNet.__init__.<locals>.<genexpr>r   éÿÿÿÿrf   rb   T)Úprg   Zfan_out)ÚmoderM   )*rR   rS   r   ri   r   r	   ÚallÚ	TypeErrorr   ÚBatchNorm2dr8   rl   r   rk   ÚsumÚranger:   Úcopyr9   r7   rG   r;   rn   ÚfeaturesZAdaptiveAvgPool2dÚavgpoolZDropoutZLinearÚ
classifierÚmodulesZConv2dÚinitZkaiming_normal_ÚweightZbiasZzeros_Z	GroupNormZones_rX   ÚsqrtZout_featuresZuniform_)rT   r{   r|   r^   r}   r_   r~   rp   Zfirstconv_output_channelsZtotal_stage_blocksZstage_block_idr]   ZstageÚ_Z	block_cnfZsd_probZlastconv_input_channelsZlastconv_output_channelsÚmZ
init_rangerU   rA   rB   rS   é   s‚    

ÿþ
     ÿÿ


ûÿ

þzEfficientNet.__init__)Úxr?   c                 C   s.   |   |¡}|  |¡}t |d¡}|  |¡}|S )Nr   )rŽ   r�   ÚtorchÚflattenr�   ©rT   r—   rA   rA   rB   Ú_forward_implL  s
    


zEfficientNet._forward_implc                 C   s
   |   |¡S rO   )r›   rš   rA   rA   rB   rw   V  s    zEfficientNet.forward)ry   rz   NN)rD   rE   rF   r	   r   rL   r[   rG   rI   r   r   r   rJ   rS   r   r›   rw   rZ   rA   rA   rU   rB   r   è   s       ùøc
)r{   r|   r~   ÚweightsÚprogressÚkwargsr?   c                 K   sT   |d k	rt |dt|jd ƒƒ t| |fd|i|—Ž}|d k	rP| |j|dd�¡ |S )Nr}   Ú
categoriesr~   T)r�   Z
check_hash)r   ÚlenÚmetar   Zload_state_dictZget_state_dict)r{   r|   r~   rœ   r�   rž   ÚmodelrA   rA   rB   Ú_efficientnetZ  s    r£   )Úarchrž   r?   c                 K   s:  |   d¡r tt| d¡| d¡d�}|ddddddƒ|d	dd
ddd
ƒ|d	dd
ddd
ƒ|d	dd
dddƒ|d	dddddƒ|d	dd
dddƒ|d	dddddƒg}d }�n’|   d¡�rtdddddd
ƒtddd
dddƒtddd
dddƒtddd
ddd	ƒtd	dddddƒtd	dd
dddƒg}d}�n|   d¡�ržtddddddƒtddd
dddƒtddd
dddƒtddd
dddƒtd	dddddƒtd	dd
dd d!ƒtd	ddd d"dƒg}d}n”|   d#¡�r$tddddddƒtddd
dddƒtddd
dd$dƒtddd
d$dd%ƒtd	dddd&d'ƒtd	dd
d&d(d)ƒtd	ddd(d*dƒg}d}ntd+| › �ƒ‚||fS ),NZefficientnet_br=   rN   ©r=   rN   r   rƒ   é    é   é   r   é   é   é(   éP   ép   éÀ   rf   é@  r1   é0   é@   é€   é    é	   é   é   i   r2   é   é°   é   i0  é   i   r3   é`   é
   éà   é   é€  é   i€  zUnsupported model type )Ú
startswithr   rL   Úpopr[   ri   )r¤   rž   Z
bneck_confr{   r~   rA   rA   rB   Ú_efficientnet_confm  sT    
ù	úù	ù	rÃ   rŸ   Ú_COMMON_META)r   r   zUhttps://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1)Zmin_sizeÚrecipe)é!   rÆ   zUhttps://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2c                
   @   sF   e Zd Zedeeddejd�eddddd	œid
dddœ–d�Z	e	Z
dS )r   zJhttps://download.pytorch.org/models/efficientnet_b0_rwightman-7f5810bc.pthr½   rµ   ©Ú	crop_sizeÚresize_sizeÚinterpolationid²P úImageNet-1Kg?5^ºIlS@g5^ºIbW@©zacc@1zacc@5gNbX9´Ø?gú~j¼ts4@ú1These weights are ported from the original paper.©Ú
num_paramsÚ_metricsÚ_opsÚ
_file_sizeÚ_docs©ÚurlZ
transformsr¡   N©rD   rE   rF   r   r   r   r   ÚBICUBICÚ_COMMON_META_V1ÚIMAGENET1K_V1ÚDEFAULTrA   rA   rA   rB   r   ·  s*      ÿþÿõúc                   @   s~   e Zd Zedeeddejd�eddddd	œid
dddœ–d�Z	edeeddej
d�edddddd	œid
dddœ–d�ZeZdS )r   zJhttps://download.pytorch.org/models/efficientnet_b1_rwightman-bac287d4.pthéð   rµ   rÇ   iîv rË   g+‡©S@g–C‹lç‹W@rÌ   g–C‹lçûå?gü©ñÒM">@rÍ   rÎ   rÔ   z@https://download.pytorch.org/models/efficientnet_b1-c27df63c.pthéÿ   zOhttps://github.com/pytorch/vision/issues/3995#new-recipe-with-lr-wd-crop-tuninggƒÀÊ¡õS@g²�ï§Æ»W@g‰A`åÐ">@á$  
                These weights improve upon the results of the original paper by using a modified version of TorchVision's
                `new training recipe
                <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_.
            )rÏ   rÅ   rÐ   rÑ   rÒ   rÓ   N)rD   rE   rF   r   r   r   r   r×   rØ   rÙ   ÚBILINEARZIMAGENET1K_V2rÚ   rA   rA   rA   rB   r   Ï  sT      ÿþÿõú   ÿþÿôûc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r    zJhttps://download.pytorch.org/models/efficientnet_b2_rwightman-c35c1473.pthi   rÇ   iê‹ rË   gôýÔxé&T@g¤p=
×ÓW@rÌ   gœÄ °rhñ?gƒÀÊ¡E–A@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r    ÿ  s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�eddddd	œid
dddœ–d�Z	e	Z
dS )r!   zJhttps://download.pytorch.org/models/efficientnet_b3_rwightman-b3899882.pthi,  r¯   rÇ   iªº rË   g�—nƒ€T@gú~j¼tX@rÌ   g¬Zd;ý?gd;ßO�—G@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r!     s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�eddddd	œid
dddœ–d�Z	e	Z
dS )r"   zJhttps://download.pytorch.org/models/efficientnet_b4_rwightman-23ab8bcd.pthi|  r¿   rÇ   i0!'rË   gj¼t“ØT@g¼t“&X@rÌ   gú~j¼t“@gžï§ÆKŸR@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r"   /  s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r#   zJhttps://download.pytorch.org/models/efficientnet_b5_lukemelas-1a07897c.pthiÈ  rÇ   i¶ÏrË   g#Ûù~jÜT@gÕxé&1(X@rÌ   gÕxé&1ˆ$@gžï§ÆK7]@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r#   G  s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r$   zJhttps://download.pytorch.org/models/efficientnet_b6_lukemelas-24a108a5.pthi  rÇ   iÀ¿�rË   g�—nƒ U@g´Èv¾Ÿ:X@rÌ   gÅ °rh3@gÝ$�•«d@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r$   _  s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r%   zJhttps://download.pytorch.org/models/efficientnet_b7_lukemelas-c5b4e57e.pthiX  rÇ   i¸côrË   g+‡ÙÎU@g'1¬:X@rÌ   gsh‘í|ßB@gš™™™™Õo@rÍ   rÎ   rÔ   NrÖ   rA   rA   rA   rB   r%   w  s*      ÿþÿõúc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r&   zBhttps://download.pytorch.org/models/efficientnet_v2_s-dd5fe13b.pthr¿   rÇ   i8nGrË   g;ßO�—U@gÕxé&18X@rÌ   g¬Zd» @g“V­T@rÝ   rÎ   rÔ   N©rD   rE   rF   r   r   r   r   rÞ   Ú_COMMON_META_V2rÙ   rÚ   rA   rA   rA   rB   r&   �  s*   üþÿõøc                
   @   sF   e Zd Zedeeddejd�edddddœid	d
ddœ–d�Z	e	Z
dS )r'   zBhttps://download.pytorch.org/models/efficientnet_v2_m-dc08266a.pthéà  rÇ   iÜ:rË   gºI+GU@gD‹lçûIX@rÌ   g¢E¶óý”8@g¸…ëQ j@rÝ   rÎ   rÔ   Nrß   rA   rA   rA   rB   r'   ­  s*   üþÿõøc                
   @   sJ   e Zd Zedeeddejddd�eddddd	œid
dddœ–d�Z	e	Z
dS )r(   zBhttps://download.pytorch.org/models/efficientnet_v2_l-59c71312.pthrá   )ç      à?râ   râ   )rÈ   rÉ   rÊ   ZmeanZstdiHfrË   gÁÊ¡E¶sU@gßO�—nrX@rÌ   g
×£p=
L@gºI+i|@rÍ   rÎ   rÔ   N)rD   rE   rF   r   r   r   r   r×   rà   rÙ   rÚ   rA   rA   rA   rB   r(   Ë  s.   ú	þÿõöZ
pretrained)rœ   T)rœ   r�   )rœ   r�   rž   r?   c                 K   s8   t  | ¡} tdddd�\}}t|| dd¡|| |f|ŽS )aØ  EfficientNet B0 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B0_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B0_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B0_Weights
        :members:
    r)   rM   r¥   r|   ry   )r   ÚverifyrÃ   r£   rÂ   ©rœ   r�   rž   r{   r~   rA   rA   rB   r)   è  s    
 
   ÿÿc                 K   s8   t  | ¡} tdddd�\}}t|| dd¡|| |f|ŽS )aØ  EfficientNet B1 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B1_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B1_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B1_Weights
        :members:
    r*   rM   çš™™™™™ñ?r¥   r|   ry   )r   rã   rÃ   r£   rÂ   rä   rA   rA   rB   r*     s    
 
   ÿÿc                 K   s8   t  | ¡} tdddd�\}}t|| dd¡|| |f|ŽS )aØ  EfficientNet B2 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B2_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B2_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B2_Weights
        :members:
    r+   rå   ç333333ó?r¥   r|   ç333333Ó?)r    rã   rÃ   r£   rÂ   rä   rA   rA   rB   r+   &  s    
 
   ÿÿc                 K   s8   t  | ¡} tdddd�\}}t|| dd¡|| |f|ŽS )aØ  EfficientNet B3 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B3_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B3_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B3_Weights
        :members:
    r,   ræ   çffffffö?r¥   r|   rç   )r!   rã   rÃ   r£   rÂ   rä   rA   rA   rB   r,   E  s    

ûúc                 K   s8   t  | ¡} tdddd�\}}t|| dd¡|| |f|ŽS )aØ  EfficientNet B4 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B4_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B4_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B4_Weights
        :members:
    r-   rè   çÍÌÌÌÌÌü?r¥   r|   çš™™™™™Ù?)r"   rã   rÃ   r£   rÂ   rä   rA   rA   rB   r-   i  s    

ûúc                 K   sL   t  | ¡} tdddd�\}}t|| dd¡|| |fdttjdd	d
�i|—ŽS )aØ  EfficientNet B5 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B5_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B5_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B5_Weights
        :members:
    r.   gš™™™™™ù?gš™™™™™@r¥   r|   rê   r_   çü©ñÒMbP?ç{®Gáz„?©ÚepsZmomentum)r#   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r.   �  s    

ûúùc                 K   sL   t  | ¡} tdddd�\}}t|| dd¡|| |fdttjdd	d
�i|—ŽS )aØ  EfficientNet B6 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B6_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B6_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B6_Weights
        :members:
    r/   ré   gÍÌÌÌÌÌ@r¥   r|   râ   r_   rë   rì   rí   )r$   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r/   ²  s    

ûúùc                 K   sL   t  | ¡} tdddd�\}}t|| dd¡|| |fdttjdd	d
�i|—ŽS )aØ  EfficientNet B7 model architecture from the `EfficientNet: Rethinking Model Scaling for Convolutional
    Neural Networks <https://arxiv.org/abs/1905.11946>`_ paper.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_B7_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_B7_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_B7_Weights
        :members:
    r0   g       @gÍÌÌÌÌÌ@r¥   r|   râ   r_   rë   rì   rí   )r%   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r0   ×  s    

ûúùc                 K   sD   t  | ¡} tdƒ\}}t|| dd¡|| |fdttjdd�i|—ŽS )aÌ  
    Constructs an EfficientNetV2-S architecture from
    `EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_V2_S_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_V2_S_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_V2_S_Weights
        :members:
    r1   r|   ry   r_   rë   ©rî   )r&   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r1   ü  s    

ûúùc                 K   sD   t  | ¡} tdƒ\}}t|| dd¡|| |fdttjdd�i|—ŽS )aÌ  
    Constructs an EfficientNetV2-M architecture from
    `EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_V2_M_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_V2_M_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_V2_M_Weights
        :members:
    r2   r|   rç   r_   rë   rï   )r'   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r2   "  s    

ûúùc                 K   sD   t  | ¡} tdƒ\}}t|| dd¡|| |fdttjdd�i|—ŽS )aÌ  
    Constructs an EfficientNetV2-L architecture from
    `EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.

    Args:
        weights (:class:`~torchvision.models.EfficientNet_V2_L_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.EfficientNet_V2_L_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.efficientnet.EfficientNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.EfficientNet_V2_L_Weights
        :members:
    r3   r|   rê   r_   rë   rï   )r(   rã   rÃ   r£   rÂ   r   r   rŠ   rä   rA   rA   rB   r3   H  s    

ûúù)Or�   rX   Údataclassesr   Ú	functoolsr   Útypingr   r   r   r   r   r	   r
   r   r˜   r   r   Ztorchvision.opsr   Zops.miscr   r   Ztransforms._presetsr   r   Úutilsr   Z_apir   r   r   Ú_metar   Z_utilsr   r   r   Ú__all__r4   rL   r[   rJ   rQ   r\   r   rG   rI   Úboolr£   ÚstrrÃ   rÄ   rH   rØ   rà   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   rÙ   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   rA   rA   rA   rB   Ú<module>   sz   (éC=sùý8 ÿýý0 ÿ  þ ÿ  þ ÿ  þ ÿ  þ" ÿ  þ" ÿ  þ# ÿ  þ# ÿ  þ# ÿ  þ$ ÿ  þ$ ÿ  þ