Shortcuts

Sintel

class torchvision.datasets.Sintel(root: ~typing.Union[str, ~pathlib.Path], split: str = 'train', pass_name: str = 'clean', transforms: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]

Sintel Dataset for optical flow.

The dataset is expected to have the following structure:

root
    Sintel
        testing
            clean
                scene_1
                scene_2
                ...
            final
                scene_1
                scene_2
                ...
        training
            clean
                scene_1
                scene_2
                ...
            final
                scene_1
                scene_2
                ...
            flow
                scene_1
                scene_2
                ...
Parameters:
  • root (str or pathlib.Path) – Root directory of the Sintel Dataset.

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

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

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

  • loader (callable, optional) – A function to load an image given its path. By default, it uses PIL as its image loader, but users could also pass in torchvision.io.decode_image for decoding image data into tensors directly.

Special-members:

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

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