Shortcuts

SceneFlowStereo

class torchvision.datasets.SceneFlowStereo(root: str, variant: str = 'FlyingThings3D', pass_name: str = 'clean', transforms: Optional[Callable] = None)[source]

Dataset interface for Scene Flow datasets. This interface provides access to the FlyingThings3D, `Monkaa and Driving datasets.

The dataset is expected to have the following structre:

root
    SceneFlow
        Monkaa
            frames_cleanpass
                scene1
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
                scene2
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
            frames_finalpass
                scene1
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
                ...
                ...
            disparity
                scene1
                    left
                        img1.pfm
                        img2.pfm
                    right
                        img1.pfm
                        img2.pfm
        FlyingThings3D
            ...
            ...
Parameters:
  • root (string) – Root directory where SceneFlow is located.

  • variant (string) – Which dataset variant to user, “FlyingThings3D” (default), “Monkaa” or “Driving”.

  • pass_name (string) – Which pass to use, “clean” (default), “final” or “both”.

  • transforms (callable, optional) – A function/transform that takes in a sample and returns a transformed version.

Special-members:

__getitem__(index: int) Tuple[source]

Return example at given index.

Parameters:

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

Returns:

A 3-tuple with (img_left, img_right, disparity). The disparity is a numpy array of shape (1, H, W) and the images are PIL images. If a valid_mask is generated within the transforms parameter, a 4-tuple with (img_left, img_right, disparity, valid_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