SceneFlowStereo¶
- class torchvision.datasets.SceneFlowStereo(root: Union[str, Path], variant: str = 'FlyingThings3D', pass_name: str = 'clean', transforms: Optional[Callable] = None)[source]¶
Dataset interface for Scene Flow datasets. This interface provides access to the FlyingThings3D, `Monkaa and Driving datasets.
The dataset is expected to have the following structure:
root SceneFlow Monkaa frames_cleanpass scene1 left img1.png img2.png right img1.png img2.png scene2 left img1.png img2.png right img1.png img2.png frames_finalpass scene1 left img1.png img2.png right img1.png img2.png ... ... disparity scene1 left img1.pfm img2.pfm right img1.pfm img2.pfm FlyingThings3D ... ...
- Parameters:
root (str or
pathlib.Path
) – Root directory where SceneFlow is located.variant (string) – Which dataset variant to user, “FlyingThings3D” (default), “Monkaa” or “Driving”.
pass_name (string) – Which pass to use, “clean” (default), “final” or “both”.
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 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: