+
     °³já"  ã                   óš   € ^ RI t ^ RIt ^ RIt^ RIHt ^ RIHtHtHtH	t	 ^ RI
Ht ^RIHtHtHt ^RIHt  ! R R]4      t ! R	 R
]4      tR# )é    N)ÚPath)ÚAnyÚCallableÚOptionalÚUnion)ÚImage)Údownload_and_extract_archiveÚextract_archiveÚverify_str_arg)ÚVisionDatasetc                   ó    a a€ ] tR t^t oRtRV3R lV 3R llltV3R lR ltV3R lR ltV3R lR	 ltV3R
 lR lt	V3R lR lt
RtVtV ;t# )Ú
Caltech101aï  `Caltech 101 <https://data.caltech.edu/records/20086>`_ Dataset.

.. warning::

    This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.

Args:
    root (str or ``pathlib.Path``): Root directory of dataset where directory
        ``caltech101`` exists or will be saved to if download is set to True.
    target_type (string or list, optional): Type of target to use, ``category`` or
        ``annotation``. Can also be a list to output a tuple with all specified
        target types.  ``category`` represents the target class, and
        ``annotation`` is a list of points from a hand-generated outline.
        Defaults to ``category``.
    transform (callable, optional): A function/transform that takes in a PIL image
        and returns a transformed version. E.g, ``transforms.RandomCrop``
    target_transform (callable, optional): A function/transform that takes in the
        target and transforms it.
    download (bool, optional): If true, downloads the dataset from the internet and
        puts it in root directory. If dataset is already downloaded, it is not
        downloaded again.

        .. warning::

            To download the dataset `gdown <https://github.com/wkentaro/gdown>`_ is required.
c                ó˜   <€ V ^8„  d   QhRS[ S[S[3,          RS[ S[S[,          S[3,          RS[S[,          RS[S[,          RS[RR/# )é   ÚrootÚtarget_typeÚ	transformÚtarget_transformÚdownloadÚreturnN)r   Ústrr   Úlistr   r   Úbool)ÚformatÚ__classdict__s   "€Ú]/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/datasets/caltech.pyÚ__annotate__ÚCaltech101.__annotate__)   sg   ø€ ÷ '#ñ '#á‘C™�IÕð'#ñ ™4¡�9¡c˜>Õ*ð'#ñ ™HÕ%ð	'#ñ
 #¡8Õ,ð'#ñ ð'#ð 
ñ'#ó    c           
     óT  <a
€ \         SV `  \        P                  P	                  VR 4      W4R7       \        P
                  ! V P                  RR7       \        V\        4      '       d   V.pV Uu. uF  p\        VRR4      NK  	  upV n
        V'       d   V P                  4        V P                  4       '       g   \        R4      h\        \        P                  ! \        P                  P	                  V P                  R4      4      4      V n        V P                   P#                  R4       RR	R
RRRRR/o
\%        \'        V
3R lV P                   4      4      V n        . V n        . V n        \/        V P                   4       F›  w  rx\1        \        P                  ! \        P                  P	                  V P                  RV4      4      4      p	V P*                  P3                  \5        ^V	^,           4      4       V P,                  P3                  W—.,          4       K�  	  R# u upi )Ú
caltech101©r   r   T©Úexist_okr   úHDataset not found or corrupted. You can use download=True to download itÚ101_ObjectCategoriesÚBACKGROUND_GoogleÚFacesÚFaces_2Ú
Faces_easyÚFaces_3Ú
MotorbikesÚMotorbikes_16Ú	airplanesÚAirplanes_Side_2c                 ó(   <€ V S9   d
   SV ,          # T # ©N© )ÚxÚname_maps   &€r   Ú<lambda>Ú%Caltech101.__init__.<locals>.<lambda>I   s   ø€ ÀqÈHÄ}¸À½Ð8[ÐZ[Ð8[r   N)ÚcategoryÚ
annotation)ÚsuperÚ__init__ÚosÚpathÚjoinÚmakedirsr   Ú
isinstancer   r   r   r   Ú_check_integrityÚRuntimeErrorÚsortedÚlistdirÚ
categoriesÚremover   ÚmapÚannotation_categoriesÚindexÚyÚ	enumerateÚlenÚextendÚrange)Úselfr   r   r   r   r   ÚtÚiÚcÚnr4   Ú	__class__s   &&&&&&    @€r   r:   ÚCaltech101.__init__)   s‘  ù€ ô 	‰ÑœŸ™Ÿ™ d¨LÓ9ÀYÐÔrÜ
�Š�D—I‘I¨Õ-Ü�k¤3×'Ò'Ø&˜-ˆKÙbmÓnÑbmÐ]^œN¨1¨mÐ=WÖXÑbmÑnˆÔçØ�M‰MŒOà×$Ñ$×&Ò&ÜÐiÓjÐjä ¤§¢¬B¯G©G¯L©L¸¿¹ÐDZÓ,[Ó!\Ó]ˆŒØ�‰×ÑÐ2Ô3ð �YØ˜)Ø˜/ØÐ+ð	
ˆô &*¬#Ô.[Ð]a×]lÑ]lÓ*mÓ%nˆÔ"à "ˆŒ
ØˆŒÜ˜dŸo™oÖ.‰DˆAÜ”B—J’JœrŸw™wŸ|™|¨D¯I©IÐ7MÈqÓQÓRÓSˆAØ�J‰J×Ñœe A q¨1¥u›oÔ.Ø�F‰F�M‰M˜!˜c�'Ö"ó /ùò1 os   Á1H%c                ó<   <€ V ^8„  d   QhRS[ RS[S[S[3,          /# ©r   rH   r   ©ÚintÚtupler   )r   r   s   "€r   r   r   R   s#   ø€ ÷ )ñ )¡ð )©©s±C¨x­ñ )r   c                ó€  € ^ RI p\        P                  ! \        P                  P                  V P                  RV P                  V P                  V,          ,          RV P                  V,          R R24      4      p. pV P                   FÌ  pVR8X  d%   VP                  V P                  V,          4       K.  VR8X  g   K7  VP                  P                  \        P                  P                  V P                  RV P                  V P                  V,          ,          R	V P                  V,          R R
24      4      pVP                  VR,          4       KÎ  	  \        V4      ^8”  d   \!        V4      MV^ ,          pV P"                  e   V P#                  V4      pV P$                  e   V P%                  V4      pW43# )zv
Args:
    index (int): Index

Returns:
    tuple: (image, target) where the type of target specified by target_type.
Nr&   Úimage_Ú04dú.jpgr7   r8   ÚAnnotationsÚannotation_z.matÚobj_contour)Úscipy.ior   Úopenr;   r<   r=   r   rD   rI   rH   r   ÚappendÚioÚloadmatrG   rK   rY   r   r   )rN   rH   ÚscipyÚimgÚtargetrO   Údatas   &&     r   Ú__getitem__ÚCaltech101.__getitem__R   s[  € ó 	ä�jŠjÜ�G‰G�L‰LØ—	‘	Ø&Ø—‘ §¡ u¥Õ.Ø˜Ÿ™ EÕ*¨3Ð/¨tÐ4ó	ó
ˆð ˆØ×!Ô!ˆAØ�JŒØ—‘˜dŸf™f U�mÖ,Ø�lÖ"Ø—x‘x×'Ñ'Ü—G‘G—L‘LØŸ	™	Ø%Ø×2Ñ2°4·6±6¸%µ=ÕAØ% d§j¡j°Õ&7¸Ð%<¸DÐAó	ó�ð —‘˜d =Õ1Ö2ñ "ô #& f£+°¤/”�v”°v¸aµyˆà�>‰>Ò%Ø—.‘. Ó%ˆCà× Ñ Ò,Ø×*Ñ*¨6Ó2ˆFàˆ{Ðr   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   ©r   )r   r   s   "€r   r   r   }   ó   ø€ ÷ Oñ O¡$ñ Or   c                ó�   € \         P                  P                  \         P                  P                  V P                  R 4      4      # )r&   ©r;   r<   Úexistsr=   r   ©rN   s   &r   r@   ÚCaltech101._check_integrity}   ó)   € ä�w‰w�~‰~œbŸg™gŸl™l¨4¯9©9Ð6LÓMÓNÐNr   c                ó    <€ V ^8„  d   QhRS[ /# rm   ©rX   )r   r   s   "€r   r   r   �   ó   ø€ ÷ ñ ™ñ r   c                ó,   € \        V P                  4      # r1   ©rK   rH   rs   s   &r   Ú__len__ÚCaltech101.__len__�   ó   € Ü�4—:‘:‹Ðr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nr2   )r   r   s   "€r   r   r   „   s   ø€ ÷ >ñ >˜$ñ >r   c                ó6  € V P                  4       '       d   R # \        RV P                  RRR7       \        P                  P                  V P                  R4      p\        P                  ! V4       FO  pVP                  R4      '       g   K  \        \        P                  P                  W4      V P                  4       KQ  	  \        P                  ! V4       \        P                  ! \        P                  P                  V P                  R4      4       R # )NzBhttps://data.caltech.edu/records/mzrjq-6wc02/files/caltech-101.zipzcaltech-101.zipÚ 3138e1922a9193bfa496528edbbc45d0)Údownload_rootÚfilenameÚmd5zcaltech-101z.gz)r@   r	   r   r;   r<   r=   rC   Úendswithr
   ÚshutilÚrmtreerE   )rN   Úgzip_folderÚ	gzip_files   &  r   r   ÚCaltech101.download„   s³   € Ø× Ñ ×"Ò"Ùä$ØPØŸ)™)Ø&Ø2õ		
ô —g‘g—l‘l 4§9¡9¨mÓ<ˆÜŸš KÖ0ˆIØ×!Ñ! %×(Ô(Ü¤§¡§¡¨[Ó DÀdÇiÁiÖPñ 1ô 	�Š�kÔ"Ü
�	Š	”"—'‘'—,‘,˜tŸy™yÐ*;Ó<Ö=r   c                ó    <€ V ^8„  d   QhRS[ /# rm   )r   )r   r   s   "€r   r   r   •   s   ø€ ÷ Dñ D™Cñ Dr   c                ó:   € R P                   ! R/ V P                  B # )zTarget type: {target_type}r2   )r   Ú__dict__rs   s   &r   Ú
extra_reprÚCaltech101.extra_repr•   s   € Ø+×2Ò2ÑC°T·]±]ÑCÐCr   )rG   rD   rH   r   rI   )r7   NNF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r:   rj   r@   r{   r   rŽ   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©rS   r   s   @@r   r   r      sR   ù‡ € ñ÷6'#õ '#÷R)ð )÷VOð O÷ð ÷>ð >÷"D÷ Dð Dr   r   c                   óŽ   a a€ ] tR t^™t oRtRV3R lV 3R llltV3R lR ltV3R lR ltV3R lR	 ltV3R
 lR lt	Rt
VtV ;t# )Ú
Caltech256a²  `Caltech 256 <https://data.caltech.edu/records/20087>`_ Dataset.

Args:
    root (str or ``pathlib.Path``): Root directory of dataset where directory
        ``caltech256`` exists or will be saved to if download is set to True.
    transform (callable, optional): A function/transform that takes in a PIL image
        and returns a transformed version. E.g, ``transforms.RandomCrop``
    target_transform (callable, optional): A function/transform that takes in the
        target and transforms it.
    download (bool, optional): If true, downloads the dataset from the internet and
        puts it in root directory. If dataset is already downloaded, it is not
        downloaded again.
c          
      óV   <€ V ^8„  d   QhRS[ RS[S[,          RS[S[,          RS[RR/# )r   r   r   r   r   r   N)r   r   r   r   )r   r   s   "€r   r   ÚCaltech256.__annotate__¨   sG   ø€ ÷ #ñ #áð#ñ ™HÕ%ð#ñ #¡8Õ,ð	#ñ
 ð#ð 
ñ#r   c           
     ó”  <€ \         S	V `  \        P                  P	                  VR 4      W#R7       \        P
                  ! V P                  RR7       V'       d   V P                  4        V P                  4       '       g   \        R4      h\        \        P                  ! \        P                  P	                  V P                  R4      4      4      V n        . V n        . V n        \        V P                  4       FÄ  w  rV\!        \        P                  ! \        P                  P	                  V P                  RV4      4       Uu. uF  pVP#                  R4      '       g   K  VNK   	  up4      pV P                  P%                  \'        ^V^,           4      4       V P                  P%                  W….,          4       KÆ  	  R# u upi )Ú
caltech256r"   Tr#   r%   Ú256_ObjectCategoriesr]   N)r9   r:   r;   r<   r=   r>   r   r   r@   rA   rB   rC   rD   rH   rI   rJ   rK   r…   rL   rM   )
rN   r   r   r   r   rP   rQ   ÚitemrR   rS   s
   &&&&&    €r   r:   ÚCaltech256.__init__¨   s7  ø€ ô 	‰ÑœŸ™Ÿ™ d¨LÓ9ÀYÐÔrÜ
�Š�D—I‘I¨Õ-çØ�M‰MŒOà×$Ñ$×&Ò&ÜÐiÓjÐjä ¤§¢¬B¯G©G¯L©L¸¿¹ÐDZÓ,[Ó!\Ó]ˆŒØ "ˆŒ
ØˆŒÜ˜dŸo™oÖ.‰DˆAÜô !#§
¢
¬2¯7©7¯<©<¸¿	¹	ÐCYÐ[\Ó+]Ô ^óá ^˜Ø—}‘} V×,÷ �DÙ ^ñóˆAð �J‰J×Ñœe A q¨1¥u›oÔ.Ø�F‰F�M‰M˜!˜c�'Ö"ó /ùòs   ÅG
Å$G
c                ó<   <€ V ^8„  d   QhRS[ RS[S[S[3,          /# rV   rW   )r   r   s   "€r   r   rœ   Æ   s#   ø€ ÷ ñ ¡ð ©©s±C¨x­ñ r   c                óÐ  € \         P                  ! \        P                  P	                  V P
                  RV P                  V P                  V,          ,          V P                  V,          ^,           R RV P                  V,          R R24      4      pV P                  V,          pV P                  e   V P                  V4      pV P                  e   V P                  V4      pW#3# )zn
Args:
    index (int): Index

Returns:
    tuple: (image, target) where target is index of the target class.
rŸ   Ú03dÚ_r\   r]   )r   rb   r;   r<   r=   r   rD   rI   rH   r   r   )rN   rH   rg   rh   s   &&  r   rj   ÚCaltech256.__getitem__Æ   s·   € ô �jŠjÜ�G‰G�L‰LØ—	‘	Ø&Ø—‘ §¡ u¥Õ.Ø—6‘6˜%•= 1Õ$ SÐ)¨¨4¯:©:°eÕ+<¸SÐ*AÀÐFó	ó
ˆð —‘˜•ˆà�>‰>Ò%Ø—.‘. Ó%ˆCà× Ñ Ò,Ø×*Ñ*¨6Ó2ˆFàˆ{Ðr   c                ó    <€ V ^8„  d   QhRS[ /# rm   rn   )r   r   s   "€r   r   rœ   á   ro   r   c                ó�   € \         P                  P                  \         P                  P                  V P                  R 4      4      # )rŸ   rq   rs   s   &r   r@   ÚCaltech256._check_integrityá   ru   r   c                ó    <€ V ^8„  d   QhRS[ /# rm   rw   )r   r   s   "€r   r   rœ   å   rx   r   c                ó,   € \        V P                  4      # r1   rz   rs   s   &r   r{   ÚCaltech256.__len__å   r}   r   c                ó   <€ V ^8„  d   QhRR/# r   r2   )r   r   s   "€r   r   rœ   è   s   ø€ ÷ 	
ñ 	
˜$ñ 	
r   c                óh   € V P                  4       '       d   R # \        RV P                  RRR7       R # )NzKhttps://data.caltech.edu/records/nyy15-4j048/files/256_ObjectCategories.tarz256_ObjectCategories.tarÚ 67b4f42ca05d46448c6bb8ecd2220f6d)rƒ   r„   )r@   r	   r   rs   s   &r   r   ÚCaltech256.downloadè   s,   € Ø× Ñ ×"Ò"Ùä$ØYØ�I‰IØ/Ø2÷		
r   )rD   rH   rI   )NNF)r�   r‘   r’   r“   r”   r:   rj   r@   r{   r   r•   r–   r—   r˜   s   @@r   rš   rš   ™   sC   ù‡ € ñ÷#õ #÷<ð ÷6Oð O÷ð ÷	
÷ 	
ð 	
r   rš   )r;   Úos.pathr†   Úpathlibr   Útypingr   r   r   r   ÚPILr   Úutilsr	   r
   r   Úvisionr   r   rš   r2   r   r   Ú<module>r·      sB   ðÛ 	Û Û Ý ß 1Ó 1å ç PÑ PÝ !ôID�ô IDôXX
�ö X
r   