Ë
    DêñiI  ã                   ó^   — d dl mZ d dlmZmZmZmZ ddlmZm	Z	 ddl
mZmZ  G d„ de	«      Zy)	é    )ÚPath)ÚAnyÚCallableÚOptionalÚUnioné   )Údefault_loaderÚImageFolder)Údownload_and_extract_archiveÚverify_str_argc                   óŠ   ‡ — e Zd ZdZdZdZddddefdeee	f   ded	e
e   d
e
e   dedeegef   ddfˆ fd„Zdefd„Zdd„Zˆ xZS )Ú
Country211aF  `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                 óp  •— t        |dd«      | _        t        |«      j                  «       }t	        |«      | _        |dz  | _        |r| j                  «        | j                  «       st        d«      ‚t        ‰| �-  t	        | j                  | j                  z  «      |||¬«       t	        |«      | _        y )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          €úa/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/torchvision/datasets/country211.pyr$   zCountry211.__init__    s¤   ø€ ô % U¨GÐ5OÓPˆŒä�D‹z×$Ñ$Ó&ˆÜ˜“IˆŒ	Ø  <Ñ/ˆÔáØ�N‰NÔà×!Ñ!Ô#ÜÐ\Ó]Ð]ä‰ÑÜ�×!Ñ! D§K¡KÑ/Ó0ØØ-Øð	 	ô 	
ô ˜“Iˆ�	ó    c                 ón   — | j                   j                  «       xr | j                   j                  «       S )N)r   ÚexistsÚis_dir©r%   s    r'   r!   zCountry211._check_exists=   s+   € Ø× Ñ ×'Ñ'Ó)ÒH¨d×.?Ñ.?×.FÑ.FÓ.HÐHr(   c                 ó~   — | j                  «       ry t        | j                  | j                  | j                  ¬«       y )N)Údownload_rootÚmd5)r!   r   Ú_URLr   Ú_MD5r,   s    r'   r    zCountry211._download@   s)   € Ø×ÑÔØÜ$ T§Y¡Y¸d¿i¹iÈTÏYÉYÖWr(   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r0   r1   r	   r   r   r   r   r   Úboolr   r$   r!   r    Ú__classcell__)r&   s   @r'   r   r      s¡   ø„ ñð( I€DØ-€Dð
 Ø(,Ø/3ØØ'5ñà�C˜�IÑðð ðð ˜HÑ%ð	ð
 # 8Ñ,ðð ðð ˜#˜ ˜Ñ$ðð 
õð:I˜tó I÷Xr(   r   N)Úpathlibr   Útypingr   r   r   r   Úfolderr	   r
   Úutilsr   r   r   © r(   r'   ú<module>r=      s"   ðÝ ß 1Ó 1ç /ß ?ô;X�õ ;Xr(   