+
     °³j@  ã                   ó„   € ^ RI t ^ RIt^ RIHt ^ RIHtHtHtHt ^ RI	H
t
 ^RIHtHt ^RIHt ^RIHt  ! R R	]4      tR# )
é    N)ÚPath)ÚAnyÚCallableÚOptionalÚUnion)ÚTensor)Úfind_classesÚmake_dataset)Ú
VideoClips)ÚVisionDatasetc                   ó°   a a€ ] tR t^t oRtRtRRRR/t^t^tRV3R lV 3R lllt	]
V3R	 lR
 l4       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# )ÚHMDB51a>  
`HMDB51 <https://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/>`_
dataset.

HMDB51 is an action recognition video dataset.
This dataset consider every video as a collection of video clips of fixed size, specified
by ``frames_per_clip``, where the step in frames between each clip is given by
``step_between_clips``.

To give an example, for 2 videos with 10 and 15 frames respectively, if ``frames_per_clip=5``
and ``step_between_clips=5``, the dataset size will be (2 + 3) = 5, where the first two
elements will come from video 1, and the next three elements from video 2.
Note that we drop clips which do not have exactly ``frames_per_clip`` elements, so not all
frames in a video might be present.

Internally, it uses a VideoClips object to handle clip creation.

Args:
    root (str or ``pathlib.Path``): Root directory of the HMDB51 Dataset.
    annotation_path (str): Path to the folder containing the split files.
    frames_per_clip (int): Number of frames in a clip.
    step_between_clips (int): Number of frames between each clip.
    fold (int, optional): Which fold to use. Should be between 1 and 3.
    train (bool, optional): If ``True``, creates a dataset from the train split,
        otherwise from the ``test`` split.
    transform (callable, optional): A function/transform that takes in a TxHxWxC video
        and returns a transformed version.
    output_format (str, optional): The format of the output video tensors (before transforms).
        Can be either "THWC" (default) or "TCHW".

Returns:
    tuple: A 3-tuple with the following entries:

        - video (Tensor[T, H, W, C] or Tensor[T, C, H, W]): The `T` video frames
        - audio(Tensor[K, L]): the audio frames, where `K` is the number of channels
          and `L` is the number of points
        - label (int): class of the video clip
zJhttps://serre-lab.clps.brown.edu/wp-content/uploads/2013/10/hmdb51_org.rarÚurlzQhttps://serre-lab.clps.brown.edu/wp-content/uploads/2013/10/test_train_splits.rarÚmd5Ú 15e67781e70dcfbdce2d7dbb9b3344b5c                 óÔ   <€ V ^8„  d   QhRS[ S[S[3,          RS[RS[RS[RS[S[,          RS[RS[RS[S[,          R	S[S[S[S[3,          ,          R
S[RS[RS[RS[RS[RS[RR/# )é   ÚrootÚannotation_pathÚframes_per_clipÚstep_between_clipsÚ
frame_rateÚfoldÚtrainÚ	transformÚ_precomputed_metadataÚnum_workersÚ_video_widthÚ_video_heightÚ_video_min_dimensionÚ_audio_samplesÚoutput_formatÚreturnN)	r   Ústrr   Úintr   Úboolr   Údictr   )ÚformatÚ__classdict__s   "€Ú\/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/datasets/hmdb51.pyÚ__annotate__ÚHMDB51.__annotate__=   sÊ   ø€ ÷ 4#ñ 4#á‘C™�IÕð4#ñ ð4#ñ ð	4#ñ
  ð4#ñ ™S•Mð4#ñ ð4#ñ ð4#ñ ™HÕ%ð4#ñ  (©©S±#¨X­Õ7ð4#ñ ð4#ñ ð4#ñ ð4#ñ "ð4#ñ ð4#ñ  ð!4#ð" 
ñ#4#ó    c                óà  <€ \         SV `  V4       VR9  d   \        RV 24      hRp\        V P                  4      w  V n        p\        V P                  VV4      V n        V P                   UUu. uF  w  ppVNK
  	  ppp\        VVVVV	V
VVVVVR7      pVV n	        W`n
        Wpn        V P                  VW&V4      V n        VP                  V P                  4      V n        W€n        R# u uppi )é   z$fold should be between 1 and 3, got )r   r   r   r    r!   r"   N)r/   r   é   )Úavi)ÚsuperÚ__init__Ú
ValueErrorr	   r   Úclassesr
   Úsamplesr   Úfull_video_clipsr   r   Ú_select_foldÚindicesÚsubsetÚvideo_clipsr   )Úselfr   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   Ú
extensionsÚclass_to_idxÚpathÚ_Úvideo_pathsr;   Ú	__class__s   &&&&&&&&&&&&&&&&      €r*   r3   ÚHMDB51.__init__=   sô   ø€ ô$ 	‰Ñ˜ÔØ�yÔ ÜÐCÀDÀ6ÐJÓKÐKàˆ
Ü%1°$·)±)Ó%<Ñ"ˆŒ�lÜ#Ø�I‰IØØó
ˆŒð .2¯\ª\Ô:©\¡	  q“t©\ˆÑ:Ü ØØØØØ!Ø#Ø%Ø'Ø!5Ø)Ø'ô
ˆð  !,ˆÔØŒ	ØŒ
Ø×(Ñ(¨°oÈUÓSˆŒØ&×-Ñ-¨d¯l©lÓ;ˆÔØ"Žùó- ;s   Á0C*c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# ©r   r#   )r'   r$   r   )r(   r)   s   "€r*   r+   r,   t   s   ø€ ÷ .ñ .™$™s¡C˜x�.ñ .r-   c                ó.   € V P                   P                  # ©N)r7   Úmetadata©r<   s   &r*   rH   ÚHMDB51.metadatas   s   € à×$Ñ$×-Ñ-Ð-r-   c                óX   <€ V ^8„  d   QhRS[ S[,          RS[RS[RS[RS[ S[,          /# )r   Ú
video_listÚannotations_dirr   r   r#   )Úlistr$   r%   r&   )r(   r)   s   "€r*   r+   r,   w   s<   ø€ ÷ ñ ¡t©C¥yð Á3ð Écð ÑZ^ð ÑcgÑhkÕclñ r-   c                ó|  € V'       d   V P                   MV P                  pR V R2p\        P                  P	                  W&4      p\
        P
                  ! V4      p\        4       p	V Fo  p
\        V
4      ;_uu_ 4       pVP                  4       pRRR4       X F:  pVP                  4       w  rï\        V4      pVV8X  g   K)  V	P                  V4       K<  	  Kq  	  . p\        V4       F=  w  pp\        P                  P                  V4      V	9   g   K,  VP                  V4       K?  	  V#   + '       g   i     L¤; i)z*test_splitz.txtN)Ú	TRAIN_TAGÚTEST_TAGÚosr?   ÚjoinÚglobÚsetÚopenÚ	readlinesÚsplitr%   ÚaddÚ	enumerateÚbasenameÚappend)r<   rL   rM   r   r   Ú
target_tagÚsplit_pattern_nameÚsplit_pattern_pathÚannotation_pathsÚselected_filesÚfilepathÚfidÚlinesÚlineÚvideo_filenameÚ
tag_stringÚtagr9   Úvideo_indexÚ
video_paths   &&&&&               r*   r8   ÚHMDB51._select_foldw   sõ   € ß',�T—^’^°$·-±-ˆ
Ø*¨4¨&°Ð5ÐÜŸW™WŸ\™\¨/ÓNÐÜŸ9š9Ð%7Ó8ÐÜ›ˆÛ(ˆHÜ�h—” 3ØŸ™›�÷  ã�Ø-1¯Z©Z«\Ñ*�Ü˜*“o�Ø˜*Ö$Ø"×&Ñ& ~Ö6ó	 ñ )ð ˆÜ'0°Ö'<Ñ#ˆK˜Ü�w‰w×Ñ 
Ó+¨~Ö=Ø—‘˜{Ö+ñ (=ð ˆ÷  —ús   Á>D+Ä+D;c                ó    <€ V ^8„  d   QhRS[ /# rE   )r%   )r(   r)   s   "€r*   r+   r,   �   s   ø€ ÷ ,ñ ,™ñ ,r-   c                ó6   € V P                   P                  4       # rG   )r;   Ú	num_clipsrI   s   &r*   Ú__len__ÚHMDB51.__len__�   s   € Ø×Ñ×)Ñ)Ó+Ð+r-   c                ó@   <€ V ^8„  d   QhRS[ RS[S[S[S[ 3,          /# )r   Úidxr#   )r%   Útupler   )r(   r)   s   "€r*   r+   r,   �   s'   ø€ ÷ )ñ )™sð )¡u©V±V¹SÐ-@Õ'Añ )r-   c                óÔ   € V P                   P                  V4      w  r#rEV P                  V,          pV P                  V,          w  rGV P                  e   V P	                  V4      pW#V3# rG   )r;   Úget_clipr9   r6   r   )r<   rr   ÚvideoÚaudior@   Ú	video_idxÚsample_indexÚclass_indexs   &&      r*   Ú__getitem__ÚHMDB51.__getitem__�   s^   € Ø%)×%5Ñ%5×%>Ñ%>¸sÓ%CÑ"ˆ�aØ—|‘| IÕ.ˆØŸ™ lÕ3‰ˆà�>‰>Ò%Ø—N‘N 5Ó)ˆEà˜[Ð(Ð(r-   )r5   r   r7   r9   r6   r   r   r;   )r/   Nr/   TNNr/   r   r   r   r   ÚTHWC)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Údata_urlÚsplitsrP   rQ   r3   ÚpropertyrH   r8   ro   r{   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)rB   r)   s   @@r*   r   r      st   ù‡ € ñ%ðN \€HàÐbØÐ1ð€Fð €IØ€H÷4#õ 4#ðl ÷.ó ð.÷ð ÷,,ð ,÷)÷ )ð )r-   r   )rT   rR   Úpathlibr   Útypingr   r   r   r   Útorchr   Úfolderr	   r
   Úvideo_utilsr   Úvisionr   r   © r-   r*   Ú<module>r�      s.   ðÛ Û 	Ý ß 1Ó 1å ç .Ý #Ý !ôK)ˆ]ö K)r-   