Shortcuts

Middlebury2014Stereo

class torchvision.datasets.Middlebury2014Stereo(root: Union[str, Path], split: str = 'train', calibration: Optional[str] = 'perfect', use_ambient_views: bool = False, transforms: Optional[Callable] = None, download: bool = False)[source]

Publicly available scenes from the Middlebury dataset 2014 version <https://vision.middlebury.edu/stereo/data/scenes2014/>.

The dataset mostly follows the original format, without containing the ambient subdirectories. :

root
    Middlebury2014
        train
            scene1-{perfect,imperfect}
                calib.txt
                im{0,1}.png
                im1E.png
                im1L.png
                disp{0,1}.pfm
                disp{0,1}-n.png
                disp{0,1}-sd.pfm
                disp{0,1}y.pfm
            scene2-{perfect,imperfect}
                calib.txt
                im{0,1}.png
                im1E.png
                im1L.png
                disp{0,1}.pfm
                disp{0,1}-n.png
                disp{0,1}-sd.pfm
                disp{0,1}y.pfm
            ...
        additional
            scene1-{perfect,imperfect}
                calib.txt
                im{0,1}.png
                im1E.png
                im1L.png
                disp{0,1}.pfm
                disp{0,1}-n.png
                disp{0,1}-sd.pfm
                disp{0,1}y.pfm
            ...
        test
            scene1
                calib.txt
                im{0,1}.png
            scene2
                calib.txt
                im{0,1}.png
            ...
Parameters:
  • root (str or pathlib.Path) – Root directory of the Middleburry 2014 Dataset.

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

  • use_ambient_views (boolean, optional) – Whether to use different expose or lightning views when possible. The dataset samples with equal probability between [im1.png, im1E.png, im1L.png].

  • calibration (string, optional) – Whether or not to use the calibrated (default) or uncalibrated scenes.

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

  • download (boolean, optional) – Whether or not to download the dataset in the root directory.

Special-members:

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

Return example at given index.

Parameters:

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

Returns:

A 4-tuple with (img_left, img_right, disparity, valid_mask). The disparity is a numpy array of shape (1, H, W) and the images are PIL images. valid_mask is implicitly None for split=test.

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