CREStereo — Torchvision 0.22 documentation (original) (raw)

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:

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