
    QЦi	                     Z    S SK r S SKJr  S SKJrJrJr  SSKJr  SSK	J
r
   " S S\5      rg)	    N)Path)CallableOptionalUnion   )ImageFolder)download_and_extract_archivec                      ^  \ rS rSrSr   SS\\\4   S\\	   S\\	   S\
SS4
U 4S	 jjjrS\4S
 jrS\
4S jrSS jrSrU =r$ )EuroSAT	   a  RGB version of the `EuroSAT <https://github.com/phelber/eurosat>`_ Dataset.

For the MS version of the dataset, see
`TorchGeo <https://torchgeo.readthedocs.io/en/stable/api/datasets.html#eurosat>`__.

Args:
    root (str or ``pathlib.Path``): Root directory of dataset where ``root/eurosat`` exists.
    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. Default is False.
Nroot	transformtarget_transformdownloadreturnc                   > [         R                  R                  U5      U l        [         R                  R	                  U R                  S5      U l        [         R                  R	                  U R
                  S5      U l        U(       a  U R                  5         U R                  5       (       d  [        S5      e[        TU ]-  U R                  X#S9  [         R                  R                  U5      U l        g )Neurosat2750z;Dataset not found. You can use download=True to download it)r   r   )ospath
expanduserr   join_base_folder_data_folderr   _check_existsRuntimeErrorsuper__init__)selfr   r   r   r   	__class__s        [/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torchvision/datasets/eurosat.pyr   EuroSAT.__init__   s     GG&&t,	GGLLI>GGLL):):FCMMO!!##\]]**icGG&&t,	    c                 ,    [        U R                  5      $ N)lensamplesr   s    r!   __len__EuroSAT.__len__.   s    4<<  r#   c                 T    [         R                  R                  U R                  5      $ r%   )r   r   existsr   r(   s    r!   r   EuroSAT._check_exists1   s    ww~~d//00r#   c                     U R                  5       (       a  g [        R                  " U R                  SS9  [	        SU R                  SS9  g )NT)exist_okzmhttps://huggingface.co/datasets/torchgeo/eurosat/resolve/c877bcd43f099cd0196738f714544e355477f3fd/EuroSAT.zip c8fa014336c82ac7804f0398fcb19387)download_rootmd5)r   r   makedirsr   r	   r(   s    r!   r   EuroSAT.download4   s?    
D%%5${++2	
r#   )r   r   r   )NNF)r   N)__name__
__module____qualname____firstlineno____doc__r   strr   r   r   boolr   intr)   r   r   __static_attributes____classcell__)r    s   @r!   r   r   	   s    & )-/3-CI- H%- #8,	-
 - 
- -(! !1t 1

 

r#   r   )r   pathlibr   typingr   r   r   folderr   utilsr	   r    r#   r!   <module>rD      s#    	  , ,  /5
k 5
r#   