class_docstr: Evenly splits the video into clips of size clip_duration.
class_docstr_tok: ["Evenly","splits","the","video","into","clips","of","size","clip_duration","."]
docstr: Args:
      clip_duration (Union[float, Fraction]):
          The length of the clip to sample (in seconds).
      stride (Union[float, Fraction], optional):
          The amount of seconds to offset the next clip by
          default value of None is equivalent to no stride => stride == clip_duration.
      eps (float):
          Epsilon for floating point comparisons. Used to check the last clip.
      backpad_last (bool):
          Whether to include the last frame(s) by "back padding".
  
          For instance, if we have a video of 39 frames (30 fps = 1.3s)
          with a stride of 16 (0.533s) with a clip duration of 32 frames
          (1.0667s). The clips will be (in frame numbers):
  
          with backpad_last = False
          - [0, 31]
  
          with backpad_last = True
          - [0, 31]
          - [8, 39], this is "back-padded" from [16, 48] to fit the last window
  Note that you can use Fraction for clip_duration and stride if you want to
  avoid float precision issue and need accurate frames in each clip.
docstr_tok: ["Args",":","clip_duration","(","Union","[","float",",","Fraction","]",")",":","The","length","of","the","clip","to","sample","(","in","seconds",")",".","stride","(","Union","[","float",",","Fraction","]",",","optional",")",":","The","amount","of","seconds","to","offset","the","next","clip","by","default","value","of","None","is","equivalent","to","no","stride","=",">","stride","==","clip_duration",".","eps","(","float",")",":","Epsilon","for","floating","point","comparisons",".","Used","to","check","the","last","clip",".","backpad_last","(","bool",")",":","Whether","to","include","the","last","frame","(","s",")","by","``","back","padding","''",".","For","instance",",","if","we","have","a","video","of","39","frames","(","30","fps","=","1.3s",")","with","a","stride","of","16","(","0.533s",")","with","a","clip","duration","of","32","frames","(","1.0667s",")",".","The","clips","will","be","(","in","frame","numbers",")",":","with","backpad_last","=","False","-","[","0",",","31","]","with","backpad_last","=","True","-","[","0",",","31","]","-","[","8",",","39","]",",","this","is","``","back-padded","''","from","[","16",",","48","]","to","fit","the","last","window","Note","that","you","can","use","Fraction","for","clip_duration","and","stride","if","you","want","to","avoid","float","precision","issue","and","need","accurate","frames","in","each","clip","."]
code: def __init__(
      self,
      clip_duration: Union[float, Fraction],
      stride: Optional[Union[float, Fraction]] = None,
      backpad_last: bool = False,
      eps: float = 1e-6,
  ):
      """
      Args:
          clip_duration (Union[float, Fraction]):
              The length of the clip to sample (in seconds).
          stride (Union[float, Fraction], optional):
              The amount of seconds to offset the next clip by
              default value of None is equivalent to no stride => stride == clip_duration.
          eps (float):
              Epsilon for floating point comparisons. Used to check the last clip.
          backpad_last (bool):
              Whether to include the last frame(s) by "back padding".
  
              For instance, if we have a video of 39 frames (30 fps = 1.3s)
              with a stride of 16 (0.533s) with a clip duration of 32 frames
              (1.0667s). The clips will be (in frame numbers):
  
              with backpad_last = False
              - [0, 31]
  
              with backpad_last = True
              - [0, 31]
              - [8, 39], this is "back-padded" from [16, 48] to fit the last window
      Note that you can use Fraction for clip_duration and stride if you want to
      avoid float precision issue and need accurate frames in each clip.
      """
      super().__init__(clip_duration)
      self._stride = (
          stride if stride is not None else self._clip_duration
      )
      self._eps = eps
      self._backpad_last = backpad_last
  
      assert self._stride > 0, "stride must be positive"
  
imports: import random
  from abc import ABC, abstractmethod
  from fractions import Fraction
  from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
label_desc: Use image node_id 1 to create a new UniformClipSampler object from inherited base classes: ClipSampler with example: obj = UniformClipSampler(clip_duration, stride, backpad_last, eps)