FlyingThings3DΒΆ
- class torchvision.datasets.FlyingThings3D(root: ~typing.Union[str, ~pathlib.Path], split: str = 'train', pass_name: str = 'clean', camera: str = 'left', transforms: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]ΒΆ
FlyingThings3D dataset for optical flow.
The dataset is expected to have the following structure:
root FlyingThings3D frames_cleanpass TEST TRAIN frames_finalpass TEST TRAIN optical_flow TEST TRAIN
- Parameters:
root (str or
pathlib.Path
) β Root directory of the intel FlyingThings3D Dataset.split (string, optional) β The dataset split, either βtrainβ (default) or βtestβ
pass_name (string, optional) β The pass to use, either βcleanβ (default) or βfinalβ or βbothβ. See link above for details on the different passes.
camera (string, optional) β Which camera to return images from. Can be either βleftβ (default) or βrightβ or βbothβ.
transforms (callable, optional) β A function/transform that takes in
img1, img2, flow, valid_flow_mask
and returns a transformed version.valid_flow_mask
is expected for consistency with other datasets which return a built-in valid mask, such asKittiFlow
.loader (callable, optional) β A function to load an image given its path. By default, it uses PIL as its image loader, but users could also pass in
torchvision.io.decode_image
for decoding image data into tensors directly.
- Special-members:
- __getitem__(index: int) Union[tuple[PIL.Image.Image, PIL.Image.Image, Optional[numpy.ndarray], Optional[numpy.ndarray]], tuple[PIL.Image.Image, PIL.Image.Image, Optional[numpy.ndarray]]] [source]ΒΆ
Return example at given index.
- Parameters:
index (int) β The index of the example to retrieve
- Returns:
A 3-tuple with
(img1, img2, flow)
. The flow is a numpy array of shape (2, H, W) and the images are PIL images.flow
is None ifsplit="test"
. If a valid flow mask is generated within thetransforms
parameter, a 4-tuple with(img1, img2, flow, valid_flow_mask)
is returned.- Return type: