ó
    Eñiì&  ã            
       ó<  • S SK r S SKrS SKrS SKrS SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJrJrJrJrJrJr  S S	KJr  S
SKJr  / SQr\ " S S5      5       r " S S\	5      rS\S\4S jrS\\\4   S\\   4S jr S\S\\   4S jr!\" S\RD                  S9r#0 r$S"S\\   S\\S\#4   /\S\#4   4   4S jjr%   S#S\\   S\\\   \S4   S\\\   \S4   S\&\   4S jjr'S\S\S\RD                  4   4S jr(S\S \S\RD                  4S! jr)g)$é    N)ÚIterable)Ú	dataclass)ÚEnum)Úpartial)Ú	signature)Ú
ModuleType)ÚAnyÚCallableÚget_argsÚOptionalÚTypeVarÚUnion)Únné   )Úload_state_dict_from_url)ÚWeightsEnumÚWeightsÚ	get_modelÚget_model_builderÚget_model_weightsÚ
get_weightÚlist_modelsc                   óT   • \ rS rSr% Sr\\S'   \\S'   \\\	4   \S'   S\	S\
4S jrS	rg
)r   é   a¯  
This class is used to group important attributes associated with the pre-trained weights.

Args:
    url (str): The location where we find the weights.
    transforms (Callable): A callable that constructs the preprocessing method (or validation preset transforms)
        needed to use the model. The reason we attach a constructor method rather than an already constructed
        object is because the specific object might have memory and thus we want to delay initialization until
        needed.
    meta (Dict[str, Any]): Stores meta-data related to the weights of the model and its configuration. These can be
        informative attributes (for example the number of parameters/flops, recipe link/methods used in training
        etc), configuration parameters (for example the `num_classes`) needed to construct the model or important
        meta-data (for example the `classes` of a classification model) needed to use the model.
ÚurlÚ
transformsÚmetaÚotherÚreturnc                 ó|  • [        U[        5      (       d  [        $ U R                  UR                  :w  a  gU R                  UR                  :w  a  g[        U R
                  [        5      (       a´  [        UR
                  [        5      (       a•  U R
                  R                  UR
                  R                  :H  =(       aa    U R
                  R                  UR
                  R                  :H  =(       a-    U R
                  R                  UR
                  R                  :H  $ U R
                  UR
                  :H  $ )NF)
Ú
isinstancer   ÚNotImplementedr   r   r   r   ÚfuncÚargsÚkeywords)Úselfr   s     ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/models/_api.pyÚ__eq__ÚWeights.__eq__*   sã   € ô ˜%¤×)Ñ)Ü!Ð!à�8‰8�u—y‘yÓ Øà�9‰9˜Ÿ
™
Ó"Øä�d—o‘o¤w×/Ñ/´J¸u×?OÑ?OÔQX×4YÑ4Yà—‘×$Ñ$¨×(8Ñ(8×(=Ñ(=Ñ=÷ JØ—O‘O×(Ñ(¨E×,<Ñ,<×,AÑ,AÑA÷Jà—O‘O×,Ñ,°×0@Ñ0@×0IÑ0IÑIðð —?‘? e×&6Ñ&6Ñ6Ð6ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚstrÚ__annotations__r
   Údictr	   Úboolr(   Ú__static_attributes__r+   r*   r'   r   r      s5   ‡ ñð 
ƒHØÓØ
ˆs�Cˆx‰.Óð7˜Cð 7 D÷ 7r*   r   c                   ó’   • \ rS rSrSr\S\S\4S j5       rS\S\S\\	\4   4S jr
S\	4S	 jr\S
 5       r\S 5       r\S 5       rSrg)r   éE   a5  
This class is the parent class of all model weights. Each model building method receives an optional `weights`
parameter with its associated pre-trained weights. It inherits from `Enum` and its values should be of type
`Weights`.

Args:
    value (Weights): The data class entry with the weight information.
Úobjr   c                 óö   • Ubu  [        U5      [        L a#  XR                  U R                  S-   S5         nU$ [	        X5      (       d0  [        SU R                   SUR                  R                   S35      eU$ )NÚ.Ú z(Invalid Weight class provided; expected z but received )Útyper1   Úreplacer,   r!   Ú	TypeErrorÚ	__class__)Úclsr8   s     r'   ÚverifyÚWeightsEnum.verifyO   s|   € à‰?Ü�C‹yœCÒØŸ+™+ c§l¡l°SÑ&8¸"Ó=Ñ>�ð
 ˆ
ô	   ×)Ñ)ÜØ>¸s¿|¹|¸nÈNÐ[^×[hÑ[h×[qÑ[qÐZrÐrsÐtóð ð ˆ
r*   r$   Úkwargsc                 ó4   • [        U R                  /UQ70 UD6$ ©N)r   r   )r&   r$   rC   s      r'   Úget_state_dictÚWeightsEnum.get_state_dictZ   s   € Ü'¨¯©ÐB°4ÒB¸6ÑBÐBr*   c                 óL   • U R                   R                   SU R                   3$ )Nr:   )r?   r,   Ú_name_©r&   s    r'   Ú__repr__ÚWeightsEnum.__repr__]   s"   € Ø—.‘.×)Ñ)Ð*¨!¨D¯K©K¨=Ð9Ð9r*   c                 ó.   • U R                   R                  $ rE   )Úvaluer   rJ   s    r'   r   ÚWeightsEnum.url`   s   € à�z‰z�~‰~Ðr*   c                 ó.   • U R                   R                  $ rE   )rN   r   rJ   s    r'   r   ÚWeightsEnum.transformsd   s   € à�z‰z×$Ñ$Ð$r*   c                 ó.   • U R                   R                  $ rE   )rN   r   rJ   s    r'   r   ÚWeightsEnum.metah   s   € à�z‰z�‰Ðr*   r+   N)r,   r-   r.   r/   r0   Úclassmethodr	   rA   r3   r1   rF   rK   Úpropertyr   r   r   r5   r+   r*   r'   r   r   E   s—   † ñð ð˜ð  ó ó ððC Cð C°3ð C¸4ÀÀSÀ¹>ô Cð:˜#ô :ð ñó ðð ñ%ó ð%ð ñó ór*   r   Únamer   c                 ó˜  •  U R                  S5      u  pSR                  [        R                  [
           R
                  R                  S5      SS 5      n[        R                  " U5      nU/[        R                  " U[        R                  5       Vs/ s H-  nUS   R                  R                  S5      (       d  M(  US   PM/     sn-   nSnU H=  nUR                  R                  US5      n	U	c  M$  [        U	[         5      (       d  M;  U	n  O   Uc  [        SU S	35      eXr   $ ! [         a    [        SU  S35      ef = fs  snf )
zÉ
Gets the weights enum value by its full name. Example: "ResNet50_Weights.IMAGENET1K_V1"

Args:
    name (str): The name of the weight enum entry.

Returns:
    WeightsEnum: The requested weight enum.
r:   zInvalid weight name provided: 'ú'.Néÿÿÿÿé   z__init__.pyzThe weight enum 'z0' for the specific method couldn't be retrieved.)ÚsplitÚ
ValueErrorÚjoinÚsysÚmodulesr,   Ú	importlibÚimport_moduleÚinspectÚ
getmembersÚismoduleÚ__file__ÚendswithÚ__dict__ÚgetÚ
issubclassr   )
rV   Ú	enum_nameÚ
value_nameÚbase_module_nameÚbase_moduleÚxÚmodel_modulesÚweights_enumÚmÚpotential_classs
             r'   r   r   m   sC  € ðEØ $§
¡
¨3£Ñˆ	ð —x‘x¤§¡¬HÑ 5× >Ñ >× DÑ DÀSÓ IÈ#È2Ð NÓOÐÜ×)Ò)Ð*:Ó;€KØ �Mä×#Ò# K´×1AÑ1AÔBó%âBˆAØˆQ‰4�=‰=×!Ñ! -×0ó 	ˆˆ!ŒÙBñ%ñ €Mð €LÛˆØŸ*™*Ÿ.™.¨°DÓ9ˆØÓ&¬:°oÄ{×+SÓ+SØ*ˆLÙñ	 ð ÑÜÐ,¨Y¨KÐ7gÐhÓiÐiàÑ#Ð#øô+ ó EÜÐ:¸4¸&ÀÐCÓDÐDðEüò
%s   ‚D* Â'EÃ	EÄ*Ec                 ó\   • [        U [        5      (       a  [        U 5      OU n[        U5      $ )a  
Returns the weights enum class associated to the given model.

Args:
    name (callable or str): The model builder function or the name under which it is registered.

Returns:
    weights_enum (WeightsEnum): The weights enum class associated with the model.
)r!   r1   r   Ú_get_enum_from_fn)rV   Úmodels     r'   r   r   ‘   s(   € ô (2°$¼×'<Ñ'<Ô˜dÔ#À$€EÜ˜UÓ#Ð#r*   Úfnc                 ó‚  • [        U 5      nSUR                  ;  a  [        S5      eUR                  S   R                  nSn[	        U[
        5      (       a  [        U[        5      (       a  UnOB[        U5       H3  n[	        U[
        5      (       d  M  [        U[        5      (       d  M1  Un  O   Uc  [        S5      eU$ )zË
Internal method that gets the weight enum of a specific model builder method.

Args:
    fn (Callable): The builder method used to create the model.
Returns:
    WeightsEnum: The requested weight enum.
Úweightsz-The method is missing the 'weights' argument.NzjThe WeightsEnum class for the specific method couldn't be retrieved. Make sure the typing info is correct.)	r   Ú
parametersr\   Ú
annotationr!   r<   ri   r   r   )rv   ÚsigÚannrp   Úts        r'   rt   rt   Ÿ   s­   € ô �B‹-€CØ˜Ÿ™Ó&ÜÐHÓIÐIà
�.‰.˜Ñ
#×
.Ñ
.€CØ€LÜ�#”t×Ñ¤¨C´×!=Ñ!=Ø‰ô ˜#–ˆAÜ˜!œT×"Ó"¤z°!´[×'AÓ'AØ �Ùñ ð
 ÑÜØxó
ð 	
ð Ðr*   ÚM)Úbound.c                 óT   ^ • S[         S[        4   S[         S[        4   4U 4S jjnU$ )Nrv   .r   c                 ón   >• Tb  TOU R                   nU[        ;   a  [        SU S35      eU [        U'   U $ )Nz/An entry is already registered under the name 'rX   )r,   ÚBUILTIN_MODELSr\   )rv   ÚkeyrV   s     €r'   ÚwrapperÚregister_model.<locals>.wrapperÅ   s@   ø€ ØÑ&‰d¨B¯K©KˆØ”.Ó ÜÐNÈsÈeÐSUÐVÓWÐWØ Œ�sÑØˆ	r*   )r
   r~   )rV   r„   s   ` r'   Úregister_modelr†   Ä   s/   ø€ ð”H˜S¤!˜VÑ$ð ¬°#´q°&Ñ)9÷ ð €Nr*   ÚmoduleÚincludeÚexcludec                 ó  • [         R                  5        VVs1 s H9  u  p4U b/  UR                  R                  SS5      S   U R                  :X  d  M7  UiM;     nnnU(       aN  [        5       n[        U[        5      (       a  U/nU H%  nU[        [        R                  " XW5      5      -  nM'     OUnU(       aC  [        U[        5      (       a  U/nU H%  nU[        [        R                  " XX5      5      -
  nM'     [        U5      $ s  snnf )aw  
Returns a list with the names of registered models.

Args:
    module (ModuleType, optional): The module from which we want to extract the available models.
    include (str or Iterable[str], optional): Filter(s) for including the models from the set of all models.
        Filters are passed to `fnmatch <https://docs.python.org/3/library/fnmatch.html>`__ to match Unix shell-style
        wildcards. In case of many filters, the results is the union of individual filters.
    exclude (str or Iterable[str], optional): Filter(s) applied after include_filters to remove models.
        Filter are passed to `fnmatch <https://docs.python.org/3/library/fnmatch.html>`__ to match Unix shell-style
        wildcards. In case of many filters, the results is removal of all the models that match any individual filter.

Returns:
    models (list): A list with the names of available models.
r:   rZ   r   )r‚   Úitemsr-   Úrsplitr,   Úsetr!   r1   ÚfnmatchÚfilterÚsorted)	r‡   rˆ   r‰   ÚkÚvÚ
all_modelsÚmodelsÚinclude_filterÚexclude_filters	            r'   r   r   Ï   sè   € ô* %×*Ñ*Ô,ôÚ,‰dˆa°±À!Ç,Á,×BUÑBUÐVYÐ[\ÓB]Ð^_ÑB`Ðdj×dsÑdsÑBs�Ñ,ð ñ ö Ü›5ˆÜ�gœs×#Ñ#Ø�iˆGÛ%ˆNØœc¤'§.¢.°Ó"LÓMÑMŠFò &ð ˆæÜ�gœs×#Ñ#Ø�iˆGÛ%ˆNØœc¤'§.¢.°Ó"LÓMÑMŠFñ &ä�&‹>Ðùó#s   ˜6DÁDc                 ór   • U R                  5       n  [        U    nU$ ! [         a    [        SU  35      ef = f)z·
Gets the model name and returns the model builder method.

Args:
    name (str): The name under which the model is registered.

Returns:
    fn (Callable): The model builder method.
zUnknown model )Úlowerr‚   ÚKeyErrorr\   )rV   rv   s     r'   r   r   ÷   sH   € ð �:‰:‹<€Dð2Ü˜DÑ!ˆð €Iøô ó 2Ü˜>¨$¨Ð0Ó1Ð1ð2ús   ’	 �6Úconfigc                 ó(   • [        U 5      nU" S0 UD6$ )a
  
Gets the model name and configuration and returns an instantiated model.

Args:
    name (str): The name under which the model is registered.
    **config (Any): parameters passed to the model builder method.

Returns:
    model (nn.Module): The initialized model.
r+   )r   )rV   rš   rv   s      r'   r   r   	  s   € ô 
˜4Ó	 €BÙ‰<�‰<Ðr*   rE   )NNN)*rŽ   r`   rb   r^   Úcollections.abcr   Údataclassesr   Úenumr   Ú	functoolsr   r   Útypesr   Útypingr	   r
   r   r   r   r   Útorchr   Ú_internally_replaced_utilsr   Ú__all__r   r   r1   r   r<   r   rt   ÚModuler~   r‚   r†   Úlistr   r   r   r+   r*   r'   Ú<module>r§      s˜  ðÛ Û Û Û 
Ý $Ý !Ý Ý Ý Ý ß D× Då å Aò y€ð ÷,7ð ,7ó ð,7ô^%�$ô %ðP!$�Sð !$˜[ô !$ðH$˜E (¨C -Ñ0ð $°T¸+Ñ5Fô $ð˜(ð  t¨KÑ'8ô ñ@ ˆC�r—y‘yÑ!€à€ñ˜ #™ð °(¸HÀSÈ!ÀVÑ<LÐ;MÈxÐX[Ð]^ÐX^ÑO_Ð;_Ñ2`õ ð $(Ø/3Ø/3ñ%Ø�ZÑ ð%à�8˜C‘= # tÐ+Ñ,ð%ð �8˜C‘= # tÐ+Ñ,ð%ð 
ˆ#�Yõ	%ðP˜Cð  H¨S°"·)±)¨^Ñ$<ô ð$�Cð  3ð ¨2¯9©9õ r*   