
    hI                     ^    S SK Jr  S SKJrJrJrJr  SSKJrJ	r	  SSK
JrJr   " S S\	5      rg)	    )Path)AnyCallableOptionalUnion   )default_loaderImageFolder)download_and_extract_archiveverify_str_argc                      ^  \ rS rSrSrSrSrSSSS\4S\\	\
4   S	\	S
\\   S\\   S\S\\	/\4   SS4U 4S jjjrS\4S jrSS jrSrU =r$ )
Country211   a  `The Country211 Data Set <https://github.com/openai/CLIP/blob/main/data/country211.md>`_ from OpenAI.

This dataset was built by filtering the images from the YFCC100m dataset
that have GPS coordinate corresponding to a ISO-3166 country code. The
dataset is balanced by sampling 150 train images, 50 validation images, and
100 test images for each country.

Args:
    root (str or ``pathlib.Path``): Root directory of the dataset.
    split (string, optional): The dataset split, supports ``"train"`` (default), ``"valid"`` and ``"test"``.
    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 into
        ``root/country211/``. 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.
z;https://openaipublic.azureedge.net/clip/data/country211.tgz 84988d7644798601126c29e9877aab6atrainNFrootsplit	transformtarget_transformdownloadloaderreturnc                 ~  > [        USS5      U l        [        U5      R                  5       n[	        U5      U l        US-  U l        U(       a  U R                  5         U R                  5       (       d  [        S5      e[        TU ]-  [	        U R                  U R                  -  5      UUUS9  [	        U5      U l        g )Nr   )r   validtest
country211z;Dataset not found. You can use download=True to download it)r   r   r   )r   _splitr   
expanduserstrr   _base_folder	_download_check_existsRuntimeErrorsuper__init__)selfr   r   r   r   r   r   	__class__s          W/var/www/auris/envauris/lib/python3.13/site-packages/torchvision/datasets/country211.pyr%   Country211.__init__    s     %UG5OPDz$$&I	 </NN!!##\]]!!DKK/0-	 	 	
 I	    c                 x    U R                   R                  5       =(       a    U R                   R                  5       $ )N)r    existsis_dirr&   s    r(   r"   Country211._check_exists=   s+      '')Hd.?.?.F.F.HHr*   c                     U R                  5       (       a  g [        U R                  U R                  U R                  S9  g )N)download_rootmd5)r"   r   _URLr   _MD5r.   s    r(   r!   Country211._download@   s,    $TYYdiiTYYWr*   )r    r   r   )r   N)__name__
__module____qualname____firstlineno____doc__r3   r4   r	   r   r   r   r   r   boolr   r%   r"   r!   __static_attributes____classcell__)r'   s   @r(   r   r      s    ( ID-D
 (,/3'5CI  H%	
 #8,  #$ 
 :It IX Xr*   r   N)pathlibr   typingr   r   r   r   folderr	   r
   utilsr   r   r    r*   r(   <module>rC      s"     1 1 / ?;X ;Xr*   