
    Ph                     B    d dl mZmZ d dlZd dlmZmZ  G d de      Zy)    )AnyDictN)
functional	Transformc                   `     e Zd ZdZej
                  fZdef fdZde	de
ee	f   de	fdZ xZS )UniformTemporalSubsamplea  Uniformly subsample ``num_samples`` indices from the temporal dimension of the video.

    Videos are expected to be of shape ``[..., T, C, H, W]`` where ``T`` denotes the temporal dimension.

    When ``num_samples`` is larger than the size of temporal dimension of the video, it
    will sample frames based on nearest neighbor interpolation.

    Args:
        num_samples (int): The number of equispaced samples to be selected
    num_samplesc                 0    t         |           || _        y N)super__init__r	   )selfr	   	__class__s     nC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torchvision/transforms/v2/_temporal.pyr   z!UniformTemporalSubsample.__init__   s    &    inptparamsreturnc                 X    | j                  t        j                  || j                        S r   )_call_kernelFuniform_temporal_subsampler	   )r   r   r   s      r   
_transformz#UniformTemporalSubsample._transform   s#      !=!=tTEUEUVVr   )__name__
__module____qualname____doc__torchTensor_transformed_typesintr   r   r   strr   __classcell__)r   s   @r   r   r      sH    	  ,,'C 'Ws WDcN Ws Wr   r   )	typingr   r   r   torchvision.transforms.v2r   r   r   r    r   r   <module>r'      s      @Wy Wr   