Table of Contents
Shortcuts

# FlyingThings3D

class torchvision.datasets.FlyingThings3D(root: str, split: str = 'train', pass_name: str = 'clean', camera: str = 'left', transforms: Optional[Callable] = None)

  FlyingThings3D dataset for optical flow.

  The dataset is expected to have the following structure:

      root
          FlyingThings3D
              frames_cleanpass
                  TEST
                  TRAIN
              frames_finalpass
                  TEST
                  TRAIN
              optical_flow
                  TEST
                  TRAIN

  Parameters:

    - root (string) – Root directory of the intel FlyingThings3D Dataset.

    - split (string, optional) – The dataset split, either “train” (default) or “test”

    - pass_name (string, optional) – The pass to use, either “clean” (default) or “final” or “both”. See link above for details on the different passes.

    - camera (string, optional) – Which camera to return images from. Can be either “left” (default) or “right” or “both”.

    - transforms (callable, optional) – A function/transform that takes in `img1, img2, flow, valid_flow_mask` and returns a transformed version. `valid_flow_mask` is expected for consistency with other datasets which return a built-in valid mask, such as `KittiFlow`.

  Special-members:

  __getitem__(index: int) → Union[Tuple[Image, Image, Optional[ndarray], Optional[ndarray]], Tuple[Image, Image, Optional[ndarray]]]

    Return example at given index.

    Parameters:

      index (int) – The index of the example to retrieve

    Returns:

      A 3-tuple with `(img1, img2, flow)`. The flow is a numpy array of shape (2, H, W) and the images are PIL images. `flow` is None if `split="test"`. If a valid flow mask is generated within the `transforms` parameter, a 4-tuple with `(img1, img2, flow, valid_flow_mask)` is returned.

    Return type:

      tuple

## 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

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.