InStereo2kΒΆ
- class torchvision.datasets.InStereo2k(root: Union[str, Path], split: str = 'train', transforms: Optional[Callable] = None)[source]ΒΆ
InStereo2k dataset.
The dataset is expected to have the following structure:
root InStereo2k train scene1 left.png right.png left_disp.png right_disp.png ... scene2 ... test scene1 left.png right.png left_disp.png right_disp.png ... scene2 ...
- Parameters:
root (str or
pathlib.Path
) β Root directory where InStereo2k is located.split (string) β Either βtrainβ or βtestβ.
transforms (callable, optional) β A function/transform that takes in a sample and returns a transformed version.
- Special-members:
- __getitem__(index: int) tuple[PIL.Image.Image, PIL.Image.Image, Optional[numpy.ndarray], numpy.ndarray] [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 avalid_mask
is generated within thetransforms
parameter, a 4-tuple with(img_left, img_right, disparity, valid_mask)
is returned.- Return type: