ó
    Eñi9  ã                   ón   • S SK Jr  S SKJrJrJrJr  SSKJr  SSK	J
r
JrJrJr  SSKJr   " S S\5      rg	)
é    )ÚPath)ÚAnyÚCallableÚOptionalÚUnioné   )Údefault_loader)Úcheck_integrityÚdownload_and_extract_archiveÚdownload_urlÚverify_str_arg)ÚVisionDatasetc                   óî   ^ • \ rS rSrSrSrSSSS.rSS	S
S.rSSSS\4S\	\
\4   S\
S\\   S\\   S\S\\	\
\4   /\4   SS4U 4S jjjrS\4S jrS\S\\\4   4S jrS\
4S jrS rS r/ SQrSrU =r$ )Ú
Flowers102é
   aó  `Oxford 102 Flower <https://www.robots.ox.ac.uk/~vgg/data/flowers/102/>`_ Dataset.

.. warning::

    This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.

Oxford 102 Flower is an image classification dataset consisting of 102 flower categories. The
flowers were chosen to be flowers commonly occurring in the United Kingdom. Each class consists of
between 40 and 258 images.

The images have large scale, pose and light variations. In addition, there are categories that
have large variations within the category, and several very similar categories.

Args:
    root (str or ``pathlib.Path``): Root directory of the dataset.
    split (string, optional): The dataset split, supports ``"train"`` (default), ``"val"``, or ``"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 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.
z2https://www.robots.ox.ac.uk/~vgg/data/flowers/102/)z102flowers.tgzÚ 52808999861908f626f3c1f4e79d11fa)zimagelabels.matÚ e0620be6f572b9609742df49c70aed4d)z	setid.matÚ a5357ecc9cb78c4bef273ce3793fc85c)ÚimageÚlabelÚsetidÚtrnidÚvalidÚtstid©ÚtrainÚvalÚtestr   NFÚrootÚsplitÚ	transformÚtarget_transformÚdownloadÚloaderÚreturnc                 ó$  >• [         TU ]  XUS9  [        USS5      U l        [	        U R
                  5      S-  U l        U R                  S-  U l        U(       a  U R                  5         U R                  5       (       d  [        S5      eSSKJn  U" U R                  U R                  S	   S   -  S
S9nX€R                  U R                        R                  5       n	U" U R                  U R                  S   S   -  S
S9n
[!        [#        U
S   S-
  R                  5       S5      5      n/ U l        / U l        U	 HM  nU R$                  R)                  X¼   5        U R&                  R)                  U R                  SUS S3-  5        MO     X`l        g )N)r!   r"   r    r   zflowers-102ÚjpgzHDataset not found or corrupted. You can use download=True to download itr   )Úloadmatr   T)Ú
squeeze_mer   Úlabelsr   Úimage_Ú05dz.jpg)ÚsuperÚ__init__r   Ú_splitr   r   Ú_base_folderÚ_images_folderr#   Ú_check_integrityÚRuntimeErrorÚscipy.ior(   Ú
_file_dictÚ_splits_mapÚtolistÚdictÚ	enumerateÚ_labelsÚ_image_filesÚappendr$   )Úselfr   r    r!   r"   r#   r$   r(   Úset_idsÚ	image_idsr*   Úimage_id_to_labelÚimage_idÚ	__class__s                €Ú\/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/datasets/flowers102.pyr.   ÚFlowers102.__init__.   sm  ø€ ô 	‰Ñ˜ÐEUÐÑVÜ$ U¨GÐ5MÓNˆŒÜ  §¡›O¨mÑ;ˆÔØ"×/Ñ/°%Ñ7ˆÔæØ�M‰MŒOà×$Ñ$×&Ñ&ÜÐiÓjÐjå$á˜$×+Ñ+¨d¯o©o¸gÑ.FÀqÑ.IÑIÐVZÑ[ˆØ×,Ñ,¨T¯[©[Ñ9Ñ:×AÑAÓCˆ	á˜×*Ñ*¨T¯_©_¸WÑ-EÀaÑ-HÑHÐUYÑZˆÜ ¤¨F°8Ñ,<¸qÑ,@×+HÑ+HÓ+JÈAÓ!NÓOÐàˆŒØˆÔÛ!ˆHØ�L‰L×ÑÐ 1Ñ ;Ô<Ø×Ñ×$Ñ$ T×%8Ñ%8¸VÀHÈSÀ>ÐQUÐ;VÑ%VÖWñ "ð �ó    c                 ó,   • [        U R                  5      $ ©N)Úlenr;   ©r=   s    rC   Ú__len__ÚFlowers102.__len__R   s   € Ü�4×$Ñ$Ó%Ð%rE   Úidxc                 óì   • U R                   U   U R                  U   p2U R                  U5      nU R                  (       a  U R                  U5      nU R                  (       a  U R	                  U5      nXC4$ rG   )r;   r:   r$   r!   r"   )r=   rL   Ú
image_filer   r   s        rC   Ú__getitem__ÚFlowers102.__getitem__U   sa   € Ø ×-Ñ-¨cÑ2°D·L±LÀÑ4E�EØ—‘˜JÓ'ˆà�>�>Ø—N‘N 5Ó)ˆEà× × Ø×)Ñ)¨%Ó0ˆEàˆ|ÐrE   c                 ó    • SU R                    3$ )Nzsplit=)r/   rI   s    rC   Ú
extra_reprÚFlowers102.extra_repra   s   € Ø˜Ÿ™�}Ð%Ð%rE   c                 ó  • U R                   R                  5       (       a  U R                   R                  5       (       d  gS H=  nU R                  U   u  p#[	        [        U R                  U-  5      U5      (       a  M=    g   g)NF©r   r   T)r1   ÚexistsÚis_dirr5   r
   Ústrr0   ©r=   ÚidÚfilenameÚmd5s       rC   r2   ÚFlowers102._check_integrityd   sm   € Ø×#Ñ#×*Ñ*×,Ñ,°×1DÑ1D×1KÑ1K×1MÑ1MØã$ˆBØ ŸO™O¨BÑ/‰MˆHÜ"¤3 t×'8Ñ'8¸8Ñ'CÓ#DÀc×JÓJÙñ %ð rE   c                 óR  • U R                  5       (       a  g [        U R                   U R                  S   S    3[	        U R
                  5      U R                  S   S   S9  S H?  nU R                  U   u  p#[        U R                  U-   [	        U R
                  5      US9  MA     g )Nr   r   r   )r\   rU   )r2   r   Ú_download_url_prefixr5   rX   r0   r   rY   s       rC   r#   ÚFlowers102.downloadn   sœ   € Ø× Ñ ×"Ñ"ØÜ$Ø×(Ñ(Ð)¨$¯/©/¸'Ñ*BÀ1Ñ*EÐ)FÐGÜ�×!Ñ!Ó"Ø—‘ Ñ(¨Ñ+ò	
ó
 %ˆBØ ŸO™O¨BÑ/‰MˆHÜ˜×2Ñ2°XÑ=¼sÀ4×CTÑCTÓ?UÐ[^Ô_ò %rE   )fzpink primrosezhard-leaved pocket orchidzcanterbury bellsz	sweet peazenglish marigoldz
tiger lilyzmoon orchidzbird of paradiseÚ	monkshoodzglobe thistleÚ
snapdragonzcolt's footzking proteazspear thistlezyellow iriszglobe-flowerzpurple coneflowerzperuvian lilyzballoon flowerzgiant white arum lilyz	fire lilyzpincushion flowerÚ
fritillaryz
red gingerzgrape hyacinthz
corn poppyzprince of wales featherszstemless gentianÚ	artichokezsweet williamÚ	carnationzgarden phloxzlove in the mistzmexican asterzalpine sea hollyzruby-lipped cattleyazcape flowerzgreat masterwortz
siam tulipzlenten rosezbarbeton daisyÚdaffodilz
sword lilyÚ
poinsettiazbolero deep blueÚ
wallflowerÚmarigoldÚ	buttercupzoxeye daisyzcommon dandelionÚpetuniaz
wild pansyÚprimulaÚ	sunflowerÚpelargoniumzbishop of llandaffÚgauraÚgeraniumzorange dahliazpink-yellow dahlia?zcautleya spicatazjapanese anemonezblack-eyed susanÚ
silverbushzcalifornian poppyÚosteospermumzspring crocuszbearded irisÚ
windflowerz
tree poppyÚgazaniaÚazaleaz
water lilyÚrosezthorn applezmorning gloryzpassion flowerÚlotusz	toad lilyÚ	anthuriumÚ
frangipaniÚclematisÚhibiscusÚ	columbinezdesert-roseztree mallowÚmagnoliaÚcyclamenÚ
watercressz
canna lilyÚhippeastrumzbee balmz	ball mossÚfoxgloveÚbougainvilleaÚcamelliaÚmallowzmexican petuniaÚbromeliazblanket flowerztrumpet creeperzblackberry lily)r0   r;   r1   r:   r/   r$   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r_   r5   r6   r	   r   rX   r   r   r   Úboolr   r.   ÚintrJ   ÚtuplerO   rR   r2   r#   ÚclassesÚ__static_attributes__Ú__classcell__)rB   s   @rC   r   r   
   sþ   ø† ñð6 PÐàGØHØBñ€Jð
 $¨G¸WÑE€Kð
 Ø(,Ø/3ØØ4Bñ"à�C˜�IÑð"ð ð"ð ˜HÑ%ð	"ð
 # 8Ñ,ð"ð ð"ð ˜%  T 	Ñ*Ð+¨SÐ0Ñ1ð"ð 
÷"ð "ðH&˜ô &ð
˜sð 
 u¨S°#¨X¡ô 
ð&˜Cô &òò
`òg†GrE   r   N)Úpathlibr   Útypingr   r   r   r   Úfolderr	   Úutilsr
   r   r   r   Úvisionr   r   © rE   rC   Ú<module>r—      s(   ðÝ ß 1Ó 1å "ç ^Ó ^Ý !ôW�õ WrE   