+
     °³jp  ã                   ó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# )	é    N)ÚPath)ÚAnyÚCallableÚOptionalÚUnion)Údefault_loader)Úcheck_integrityÚdownload_and_extract_archiveÚdownload_url)ÚVisionDatasetc                   ó¢   a a€ ] tR t^t oRtRtRtRtRRR]3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# )ÚSBUaÌ  `SBU Captioned Photo <http://www.cs.virginia.edu/~vicente/sbucaptions/>`_ Dataset.

Args:
    root (str or ``pathlib.Path``): Root directory of dataset where tarball
        ``SBUCaptionedPhotoDataset.tar.gz`` exists.
    transform (callable, optional): A function/transform that takes in a PIL image or torch.Tensor, depends on the given loader,
        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.
    loader (callable, optional): A function to load an image given its path.
        By default, it uses PIL as its image loader, but users could also pass in
        ``torchvision.io.decode_image`` for decoding image data into tensors directly.
zHhttps://www.cs.rice.edu/~vo9/sbucaptions/SBUCaptionedPhotoDataset.tar.gzzSBUCaptionedPhotoDataset.tar.gzÚ 9aec147b3488753cf758b4d493422285NTc                óŠ   <€ V ^8„  d   QhRS[ S[S[3,          RS[S[,          RS[S[,          RS[RS[S[.S[3,          RR/# )é   ÚrootÚ	transformÚtarget_transformÚdownloadÚloaderÚreturnN)r   Ústrr   r   r   Úboolr   )ÚformatÚ__classdict__s   "€ÚY/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/datasets/sbu.pyÚ__annotate__ÚSBU.__annotate__!   se   ø€ ÷ .ñ .á‘C™�IÕð.ñ ™HÕ%ð.ñ #¡8Õ,ð	.ñ
 ð.ñ ™#˜¡˜Õ$ð.ð 
ñ.ó    c                óL  <€ \         SV `  WVR 7       WPn        V'       d   V P                  4        V P	                  4       '       g   \        R4      h. V n        . V n        \        P                  P                  V P                  RR4      p\        P                  P                  V P                  RR4      p\        \        V4      \        V4      4       FÌ  w  r‰VP                  4       p
\        P                  P                  V
4      p\        P                  P                  V P                  RV4      p\        P                  P!                  V4      '       g   K†  V	P                  4       pV P                  P#                  V4       V P                  P#                  V4       KÎ  	  R# ))r   r   zHDataset not found or corrupted. You can use download=True to download itÚdatasetú$SBU_captioned_photo_dataset_urls.txtz(SBU_captioned_photo_dataset_captions.txtN)ÚsuperÚ__init__r   r   Ú_check_integrityÚRuntimeErrorÚphotosÚcaptionsÚosÚpathÚjoinr   ÚzipÚopenÚrstripÚbasenameÚexistsÚappend)Úselfr   r   r   r   r   Úfile1Úfile2Úline1Úline2ÚurlÚphotoÚfilenameÚcaptionÚ	__class__s   &&&&&&        €r   r$   ÚSBU.__init__!   s   ø€ ô 	‰Ñ˜ÐEUÐÔVØŒçØ�M‰MŒOà×$Ñ$×&Ò&ÜÐiÓjÐjð ˆŒØˆŒä—‘—‘˜TŸY™Y¨	Ð3YÓZˆÜ—‘—‘˜TŸY™Y¨	Ð3]Ó^ˆä¤ U£¬T°%«[Ö9‰LˆEØ—,‘,“.ˆCÜ—G‘G×$Ñ$ SÓ)ˆEÜ—w‘w—|‘| D§I¡I¨y¸%Ó@ˆHÜ�w‰w�~‰~˜h×'Ô'ØŸ,™,›.�Ø—‘×"Ñ" 5Ô)Ø—‘×$Ñ$ WÖ-ó :r   c                ó<   <€ V ^8„  d   QhRS[ RS[S[S[3,          /# )r   Úindexr   )ÚintÚtupler   )r   r   s   "€r   r   r   B   s#   ø€ ÷ ñ ¡ð ©©s±C¨x­ñ r   c                óD  € \         P                  P                  V P                  RV P                  V,          4      pV P                  V4      pV P                  e   V P                  V4      pV P                  V,          pV P                  e   V P                  V4      pW43# )zl
Args:
    index (int): Index

Returns:
    tuple: (image, target) where target is a caption for the photo.
r!   )	r)   r*   r+   r   r'   r   r   r(   r   )r2   r>   r9   ÚimgÚtargets   &&   r   Ú__getitem__ÚSBU.__getitem__B   s   € ô —7‘7—<‘< §	¡	¨9°d·k±kÀ%Õ6HÓIˆØ�k‰k˜(Ó#ˆØ�>‰>Ò%Ø—.‘. Ó%ˆCà—‘˜uÕ%ˆØ× Ñ Ò,Ø×*Ñ*¨6Ó2ˆFàˆ{Ðr   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   )r?   )r   r   s   "€r   r   r   U   s   ø€ ÷  ñ  ™ñ  r   c                ó,   € \        V P                  4      # )z$The number of photos in the dataset.)Úlenr'   )r2   s   &r   Ú__len__ÚSBU.__len__U   s   € ä�4—;‘;ÓÐr   c                ó    <€ V ^8„  d   QhRS[ /# rG   )r   )r   r   s   "€r   r   r   Y   s   ø€ ÷ ñ ¡$ñ r   c                óª   € V P                   p\        P                  P                  WP                  4      p\        W P                  4      '       g   R# R# )z1Check the md5 checksum of the downloaded tarball.FT)r   r)   r*   r+   r9   r	   Úmd5_checksum)r2   r   Úfpaths   &  r   r%   ÚSBU._check_integrityY   s8   € à�y‰yˆÜ—‘—‘˜T§=¡=Ó1ˆÜ˜u×&7Ñ&7×8Ò8ÙÙr   c                ó   <€ V ^8„  d   QhRR/# )r   r   N© )r   r   s   "€r   r   r   a   s   ø€ ÷ ñ ˜$ñ r   c           
     ó*  € V P                  4       '       d   R# \        V P                  V P                  V P                  V P                  V P
                  4       \        \        P                  P                  V P                  RR4      4      ;_uu_ 4       pV FH  pVP                  4       p \        V\        P                  P                  V P                  R4      4       KJ  	  RRR4       R#   \         d     Kd  i ; i  + '       g   i     R# ; i)zEDownload and extract the tarball, and download each individual photo.Nr!   r"   )r%   r
   r7   r   r9   rN   r-   r)   r*   r+   r.   r   ÚOSError)r2   ÚfhÚliner7   s   &   r   r   ÚSBU.downloada   sÆ   € ð × Ñ ×"Ò"Ùä$ T§X¡X¨t¯y©y¸$¿)¹)ÀTÇ]Á]ÐTX×TeÑTeÔfô ”"—'‘'—,‘,˜tŸy™y¨)Ð5[Ó\×]Ô]ÐacÛ�Ø—k‘k“m�ðÜ  ¤b§g¡g§l¡l°4·9±9¸iÓ&HÖIñ ÷ ^Ñ]øô
 ô ò ðú÷ ^×]Ð]ús0   ÂDÂ-4C/Ã!DÃ/C>	Ã:DÃ=C>	Ã>DÄD	)r(   r   r'   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r7   r9   rN   r   r$   rD   rJ   r%   r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r;   r   s   @@r   r   r      sb   ù‡ € ñð" U€CØ0€HØ5€Lð
 )-Ø/3ØØ'5÷.õ .÷Bð ÷& ð  ÷ð ÷÷ ð r   r   )r)   Úpathlibr   Útypingr   r   r   r   Úfolderr   Úutilsr	   r
   r   Úvisionr   r   rR   r   r   Ú<module>re      s+   ðÛ 	Ý ß 1Ó 1å "ç NÑ NÝ !ôgˆ-ö gr   