FallingThingsStereo¶
- class torchvision.datasets.FallingThingsStereo(root: str, variant: str = 'single', transforms: Optional[Callable] = None)[source]¶
FallingThings dataset.
The dataset is expected to have the following structure:
root FallingThings single dir1 scene1 _object_settings.json _camera_settings.json image1.left.depth.png image1.right.depth.png image1.left.jpg image1.right.jpg image2.left.depth.png image2.right.depth.png image2.left.jpg image2.right ... scene2 ... mixed scene1 _object_settings.json _camera_settings.json image1.left.depth.png image1.right.depth.png image1.left.jpg image1.right.jpg image2.left.depth.png image2.right.depth.png image2.left.jpg image2.right ... scene2 ...
- Parameters:
root (string) – Root directory where FallingThings is located.
variant (string) – Which variant to use. Either “single”, “mixed”, 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: