Shortcuts

CREStereo

class torchvision.datasets.CREStereo(root: Union[str, Path], transforms: Optional[Callable] = None)[source]

Synthetic dataset used in training the CREStereo architecture. Dataset details on the official paper repo.

The dataset is expected to have the following structure:

root
    CREStereo
        tree
            img1_left.jpg
            img1_right.jpg
            img1_left.disp.jpg
            img1_right.disp.jpg
            img2_left.jpg
            img2_right.jpg
            img2_left.disp.jpg
            img2_right.disp.jpg
            ...
        shapenet
            img1_left.jpg
            img1_right.jpg
            img1_left.disp.jpg
            img1_right.disp.jpg
            ...
        reflective
            img1_left.jpg
            img1_right.jpg
            img1_left.disp.jpg
            img1_right.disp.jpg
            ...
        hole
            img1_left.jpg
            img1_right.jpg
            img1_left.disp.jpg
            img1_right.disp.jpg
            ...
Parameters:
  • root (str) – Root directory of the dataset.

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

Special-members:

__getitem__(index: int) Tuple[Image, Image, Optional[ndarray], 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 if the transforms parameter does not generate a valid mask.

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