FlyingChairs¶
-
class
torchvision.datasets.FlyingChairs(root, split='train', transforms=None)[source]¶ FlyingChairs Dataset for optical flow.
You will also need to download the FlyingChairs_train_val.txt file from the dataset page.
The dataset is expected to have the following structure:
root FlyingChairs data 00001_flow.flo 00001_img1.ppm 00001_img2.ppm ... FlyingChairs_train_val.txt
- Parameters
root (string) – Root directory of the FlyingChairs Dataset.
split (string, optional) – The dataset split, either “train” (default) or “val”
transforms (callable, optional) – A function/transform that takes in
img1, img2, flow, valid_flow_maskand returns a transformed version.valid_flow_maskis expected for consistency with other datasets which return a built-in valid mask, such asKittiFlow.
- Special-members
-
__getitem__(index)[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.flowis None ifsplit="val". If a valid flow mask is generated within thetransformsparameter, a 4-tuple with(img1, img2, flow, valid_flow_mask)is returned.- Return type