Shortcuts

MovingMNIST

class torchvision.datasets.MovingMNIST(root: Union[str, Path], split: Optional[str] = None, split_ratio: int = 10, download: bool = False, transform: Optional[Callable] = None)[source]

MovingMNIST Dataset.

Parameters:
  • root (str or pathlib.Path) – Root directory of dataset where MovingMNIST/mnist_test_seq.npy exists.

  • split (string, optional) – The dataset split, supports None (default), "train" and "test". If split=None, the full data is returned.

  • split_ratio (int, optional) – The split ratio of number of frames. If split="train", the first split frames data[:, :split_ratio] is returned. If split="test", the last split frames data[:, split_ratio:] is returned. If split=None, this parameter is ignored and the all frames data is returned.

  • transform (callable, optional) – A function/transform that takes in a torch Tensor and returns a transformed version. E.g, transforms.RandomCrop

  • 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.

Special-members:

__getitem__(idx: int) Tensor[source]
Parameters:

idx (int) – Index

Returns:

Video frames (torch Tensor[T, C, H, W]). The T is the number of frames.

Return type:

torch.Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources