CREStereo¶
- class torchvision.datasets.CREStereo(root: str, 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 [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 implicitlyNone
if thetransforms
parameter does not generate a valid mask.- Return type: