+
     °³jž  ã                   óh   € ^ RI 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)ÚAnyÚCallableÚOptionalÚUnion)ÚImage)Ú_decompressÚdownload_file_from_google_driveÚverify_str_arg)ÚVisionDatasetc            	       ó¶   a a€ ] tR t^
t oRtRRRRR/RRRRR/RRRR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# )ÚPCAMa€  `PCAM Dataset   <https://github.com/basveeling/pcam>`_.

The PatchCamelyon dataset is a binary classification dataset with 327,680
color images (96px x 96px), extracted from histopathologic scans of lymph node
sections. Each image is annotated with a binary label indicating presence of
metastatic tissue.

This dataset requires the ``h5py`` package which you can install with ``pip install h5py``.

Args:
     root (str or ``pathlib.Path``): Root directory of the dataset.
     split (string, optional): The dataset split, supports ``"train"`` (default), ``"test"`` or ``"val"``.
     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 into ``root/pcam``. If
         dataset is already downloaded, it is not downloaded again.

         .. warning::

            To download the dataset `gdown <https://github.com/wkentaro/gdown>`_ is required.
ÚtrainÚimagesÚtargetsÚtestÚvalc          
      ó‚   <€ V ^8„  d   QhRS[ S[S[P                  3,          RS[RS[S[,          RS[S[,          RS[/# )é   ÚrootÚsplitÚ	transformÚtarget_transformÚdownload)r   ÚstrÚpathlibÚPathr   r   Úbool)ÚformatÚ__classdict__s   "€ÚZ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/datasets/pcam.pyÚ__annotate__ÚPCAM.__annotate__I   s\   ø€ ÷ ^ñ ^á‘C™Ÿ™Ð%Õ&ð^ñ ð^ñ ™HÕ%ð	^ñ
 #¡8Õ,ð^ñ ñ^ó    c                ób  <€  ^ RI pW`n         \        TRR4      T n        \
        ST `  YTR7       \        P                  ! T P                  4      R,          T n
        T'       d   T P                  4        T P                  4       '       g   \        R4      hR#   \         d    \        R4      hi ; i)r   NzYh5py is not found. This dataset needs to have h5py installed: please run pip install h5pyr   )r   r   Úpcamz;Dataset not found. You can use download=True to download it)r   r   r   )Úh5pyÚImportErrorÚRuntimeErrorr
   Ú_splitÚsuperÚ__init__r   r   r   Ú_base_folderÚ	_downloadÚ_check_exists)Úselfr   r   r   r   r   r&   Ú	__class__s   &&&&&& €r    r+   ÚPCAM.__init__I   sž   ø€ ð	ÛàŒIô % U¨GÐ5MÓNˆŒä‰Ñ˜ÐEUÐÔVÜ#ŸLšL¨¯©Ó3°fÕ<ˆÔçØ�N‰NÔà×!Ñ!×#Ò#ÜÐ\Ó]Ð]ñ $øô ô 	ÜØkóð ð	ús   ƒ
B ÂB.c                ó    <€ V ^8„  d   QhRS[ /# ©r   Úreturn)Úint)r   r   s   "€r    r!   r"   e   s   ø€ ÷ -ñ -™ñ -r#   c                ó2  € V P                   V P                  ,          R ,          ^ ,          pV P                  P                  V P                  V,          4      ;_uu_ 4       pVR,          P
                  ^ ,          uuRRR4       #   + '       g   i     R# ; i)r   ÚxN)Ú_FILESr)   r&   ÚFiler,   Úshape)r/   Úimages_fileÚimages_datas   &  r    Ú__len__ÚPCAM.__len__e   s`   € Ø—k‘k $§+¡+Õ.¨xÕ8¸Õ;ˆØ�Y‰Y�^‰^˜D×-Ñ-°Õ;×<Ô<ÀØ˜sÕ#×)Ñ)¨!Õ,÷ =×<×<Ó<ús   Á BÂB	c                ó<   <€ V ^8„  d   QhRS[ RS[S[S[3,          /# )r   Úidxr4   )r5   Útupler   )r   r   s   "€r    r!   r"   j   s#   ø€ ÷ ñ ™sð ¡u©S±#¨X¥ñ r#   c           	     ó"  € V P                   V P                  ,          R ,          ^ ,          pV P                  P                  V P                  V,          4      ;_uu_ 4       p\
        P                  ! VR,          V,          4      P                  R4      pRRR4       V P                   V P                  ,          R,          ^ ,          pV P                  P                  V P                  V,          4      ;_uu_ 4       p\        VR,          V^ ^ ^ 3,          4      pRRR4       V P                  '       d   V P                  X4      pV P                  '       d   V P                  X4      pXX3#   + '       g   i     Lß; i  + '       g   i     Lm; i)r   r7   ÚRGBNr   Úy)r8   r)   r&   r9   r,   r   Ú	fromarrayÚconvertr5   r   r   )r/   r@   r;   r<   ÚimageÚtargets_fileÚtargets_dataÚtargets   &&      r    Ú__getitem__ÚPCAM.__getitem__j   s  € Ø—k‘k $§+¡+Õ.¨xÕ8¸Õ;ˆØ�Y‰Y�^‰^˜D×-Ñ-°Õ;×<Ô<ÀÜ—O’O K°Õ$4°SÕ$9Ó:×BÑBÀ5ÓIˆE÷ =ð —{‘{ 4§;¡;Õ/°	Õ:¸1Õ=ˆØ�Y‰Y�^‰^˜D×-Ñ-°Õ<×=Ô=ÀÜ˜ cÕ*¨3°°1°a¨<Õ8Ó9ˆF÷ >ð �>�>ˆ>Ø—N‘N 5Ó)ˆEØ× × Ð Ø×*Ñ*¨6Ó2ˆFà�fˆ}Ð÷ =×<ú÷ >×=ús   Á 4E+Ã;E>Å+E;	Å>F	c                ó    <€ V ^8„  d   QhRS[ /# r3   )r   )r   r   s   "€r    r!   r"   z   s   ø€ ÷ lñ l™tñ lr#   c                ó(  a € S P                   S P                  ,          R ,          ^ ,          pS P                   S P                  ,          R,          ^ ,          p\        ;QJ d     V 3R lW3 4       F  '       d   K   R# 	  R# ! V 3R lW3 4       4      # )r   r   c              3   óv   <"  € T F.  pSP                   P                  V4      P                  4       x € K0  	  R # 5i)N)r,   ÚjoinpathÚexists)Ú.0Úh5_filer/   s   & €r    Ú	<genexpr>Ú%PCAM._check_exists.<locals>.<genexpr>}   s0   øé € ÐkÑOjÀG�4×$Ñ$×-Ñ-¨gÓ6×=Ñ=×?Ð?ÓOjùs   ƒ69FT)r8   r)   Úall)r/   r;   rH   s   f  r    r.   ÚPCAM._check_existsz   sl   ø€ Ø—k‘k $§+¡+Õ.¨xÕ8¸Õ;ˆØ—{‘{ 4§;¡;Õ/°	Õ:¸1Õ=ˆß‹sÔkÐP[ÑOjÓk�sŒsÐkŠsÐkˆsÔkÐP[ÑOjÓkÓkÐkr#   c                ó   <€ V ^8„  d   QhRR/# )r   r4   N© )r   r   s   "€r    r!   r"      s   ø€ ÷ ?ñ ?˜4ñ ?r#   c                ó>  € V P                  4       '       d   R # V P                  V P                  ,          P                  4        FU  w  rpVR,           p\	        V\        V P                  4      WCR7       \        \        V P                  V,          4      4       KW  	  R # )Nz.gz)ÚfilenameÚmd5)r.   r8   r)   Úvaluesr	   r   r,   r   )r/   Ú	file_nameÚfile_idr\   Úarchive_names   &    r    r-   ÚPCAM._download   st   € Ø×Ñ×ÒÙà'+§{¡{°4·;±;Õ'?×'FÑ'FÖ'HÑ#ˆI Ø$ uÕ,ˆLÜ+¨G´S¸×9JÑ9JÓ5KÐVbÕlÜœ˜D×-Ñ-°Õ<Ó=Ö>ó (Ir#   )r,   r)   r&   )z&camelyonpatch_level_2_split_train_x.h5z!1Ka0XfEMiwgCYPdTI-vv6eUElOBnKFKQ2Ú 1571f514728f59376b705fc836ff4b63)z&camelyonpatch_level_2_split_train_y.h5z!1269yhu3pZDP8UYFQs-NYs3FPwuK-nGSGÚ 35c2d7259d906cfc8143347bb8e05be7)z%camelyonpatch_level_2_split_test_x.h5Ú!1qV65ZqZvWzuIVthK8eVDhIwrbnsJdbg_Ú d8c2d60d490dbd479f8199bdfa0cf6ec)z%camelyonpatch_level_2_split_test_y.h5Ú!17BHrSrwWKjYsOgTMmoqrIjDy6Fa2o_gPÚ 60a7035772fbdb7f34eb86d4420cf66a)z&camelyonpatch_level_2_split_valid_x.h5z!1hgshYGWK8V-eGRy8LToWJJgDU_rXWVJ3Ú d5b63470df7cfa627aeec8b9dc0c066e)z&camelyonpatch_level_2_split_valid_y.h5z!1bH8ZRbhSVAhScTS0p9-ZzGnX91cHT3uOÚ 2b85f58b927af9964a4c15b8f7e8f179)r   NNF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r8   r+   r=   rK   r.   r-   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r0   r   s   @@r    r   r   
   s¡   ù‡ € ñð0 	Øð ð
 ð ð
ð 	Øð ð
 ð ð
ð 	Øð ð
 ð ð
ð3%€F÷N^õ ^÷8-ð -÷
ð ÷ lð l÷
?÷ ?ð ?r#   r   )r   Útypingr   r   r   r   ÚPILr   Úutilsr   r	   r
   Úvisionr   r   rY   r#   r    Ú<module>rv      s(   ðÛ ß 1Ó 1å ç OÑ OÝ !ô|?ˆ=ö |?r#   