ETH3DStereo — Torchvision 0.22 documentation (original) (raw)
class torchvision.datasets.ETH3DStereo(root: Union[str, Path], split: str = 'train', transforms: Optional[Callable] = None)[source]¶
ETH3D Low-Res Two-View dataset.
The dataset is expected to have the following structure:
root ETH3D two_view_training scene1 im1.png im0.png images.txt cameras.txt calib.txt scene2 im1.png im0.png images.txt cameras.txt calib.txt ... two_view_training_gt scene1 disp0GT.pfm mask0nocc.png scene2 disp0GT.pfm mask0nocc.png ... two_view_testing scene1 im1.png im0.png images.txt cameras.txt calib.txt scene2 im1.png im0.png images.txt cameras.txt calib.txt ...
Parameters:
- root (str or
pathlib.Path
) – Root directory of the ETH3D Dataset. - split (string , optional) – The dataset split of scenes, either “train” (default) or “test”.
- 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]][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. Both disparity
and valid_mask
are None
if the dataset split is test.
Return type: