a
    d                     @   s   d dl Z d dlmZmZ d dlmZmZmZmZ d dl	m
Z
mZmZmZmZmZ g dZeG dd dZdd
dZeG dd dZdS )    N)dequedefaultdict)	dataclassfieldreplaceasdict)AnyDequeDictTupleOptionalUnion)PretrainedCfgfilter_pretrained_cfg
DefaultCfgc                   @   s  e Zd ZU dZdZeeeeeef f  e	d< dZ
ee e	d< dZeeeef  e	d< dZee e	d< dZee e	d< dZee e	d< dZee e	d	< dZee e	d
< dZee	d< dZeeeef e	d< dZeeeeef  e	d< dZeeeeef  e	d< dZee	d< dZee	d< dZee	d< dZee e	d< dZee	d< dZeedf e	d< dZ eedf e	d< dZ!ee	d< dZ"ee e	d < dZ#eee  e	d!< dZ$eeeef  e	d"< dZ%eeedf  e	d#< dZ&eeedf  e	d$< dZ'ee e	d%< dZ(ee e	d&< dZ)ee e	d'< dZ*ee e	d(< dZ+ee e	d)< dZ,ee e	d*< dZ-eeeee f  e	d+< dZ.eee  e	d,< e/d-d. Z0d2d0d1Z1dS )3r   z
    Nurlfile
state_dict	hf_hub_idhf_hub_filenamesourcearchitecturetagFcustom_load)      r   
input_sizetest_input_sizemin_input_sizefixed_input_sizeZbicubicinterpolationg      ?crop_pcttest_crop_pctcenter	crop_mode)g
ףp=
?gv/?gCl?.mean)gZd;O?gy&1?g?stdi  num_classeslabel_offsetlabel_nameslabel_descriptions	pool_sizetest_pool_size
first_conv
classifierlicensedescription
origin_url
paper_name	paper_idsnotesc                 C   s   | j p| jp| jS )N)r   r   r   self r7   `/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/timm/models/_pretrained.pyhas_weights9   s    zPretrainedCfg.has_weightsTc                 C   s   t t| ||dS )N)remove_sourceremove_null)r   r   )r6   r:   r;   r7   r7   r8   to_dict=   s
    zPretrainedCfg.to_dict)FT)2__name__
__module____qualname____doc__r   r   r   strr   __annotations__r   r   r
   r   r   r   r   r   r   r   boolr   intr   r   r   r    r!   floatr"   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   propertyr9   r<   r7   r7   r7   r8   r   
   sJ   
 
r   FTc                 C   sN   i }h d}|   D ]4\}}|r*|dv r*q|r@|d u r@||vr@q|||< q|S )N>   r+   r.   r-   >   r   r   r   r   r   )items)cfgr:   r;   Zfiltered_cfgZ	keep_nullkvr7   r7   r8   r   E   s    
r   c                   @   sb   e Zd ZU eedZee ed< ee	dZ
eeef ed< dZeed< edd Zedd	 Zd
S )r   )default_factorytagscfgsFis_pretrainedc                 C   s   | j | jd  S Nr   )rM   rL   r5   r7   r7   r8   defaultW   s    zDefaultCfg.defaultc                 C   s   | j d }|| j| fS rO   )rL   rM   )r6   r   r7   r7   r8   default_with_tag[   s    
zDefaultCfg.default_with_tagN)r=   r>   r?   r   r   rL   r	   rA   rB   dictrM   r
   r   rN   rC   rF   rP   rQ   r7   r7   r7   r8   r   Q   s   

r   )FT)copycollectionsr   r   Zdataclassesr   r   r   r   typingr   r	   r
   r   r   r   __all__r   r   r   r7   r7   r7   r8   <module>   s    :
