class_docstr: `KITTI <http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow>`__ dataset for optical flow (2015).
  
  The dataset is expected to have the following structure: ::
  
      root
          KittiFlow
              testing
                  image_2
              training
                  image_2
                  flow_occ
  
  Args:
      root (string): Root directory of the KittiFlow Dataset.
      split (string, optional): The dataset split, either "train" (default) or "test"
      transforms (callable, optional): A function/transform that takes in
          ``img1, img2, flow, valid_flow_mask`` and returns a transformed version.
class_docstr_tok: ["`","KITTI","<","http",":","\/\/www.cvlibs.net\/datasets\/kitti\/eval_scene_flow.php","?","benchmark=flow",">","`","__","dataset","for","optical","flow","(","2015",")",".","The","dataset","is","expected","to","have","the","following","structure",":",":",":","root","KittiFlow","testing","image_2","training","image_2","flow_occ","Args",":","root","(","string",")",":","Root","directory","of","the","KittiFlow","Dataset",".","split","(","string",",","optional",")",":","The","dataset","split",",","either","``","train","''","(","default",")","or","``","test","''","transforms","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","``","img1",",","img2",",","flow",",","valid_flow_mask","``","and","returns","a","transformed","version","."]
code: def __init__(
      self,
      root: str,
      split: str = "train",
      transforms: Optional[Callable] = None,
  ) -> None:
      super().__init__(root=root, transforms=transforms)
  
      verify_str_arg(split, "split", valid_values=("train", "test"))
  
      root = Path(root) / "KittiFlow" / (split + "ing")
      images1 = sorted(glob(str(root / "image_2" / "*_10.png")))
      images2 = sorted(glob(str(root / "image_2" / "*_11.png")))
  
      if not images1 or not images2:
          raise FileNotFoundError(
              "Could not find the Kitti flow images. Please make sure the directory structure is correct."
          )
  
      for img1, img2 in zip(images1, images2):
          self._image_list += [[img1, img2]]
  
      if split == "train":
          self._flow_list = sorted(
              glob(str(root / "flow_occ" / "*_10.png"))
          )
  
imports: import itertools
  import os
  from abc import ABC, abstractmethod
  from glob import glob
  from pathlib import Path
  from typing import Callable, List, Optional, Tuple, Union
  import numpy
  import torch
  from PIL import Image
  from ..io.image import _read_png_16
  from .utils import _read_pfm, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 1 to create a new KittiFlow object from inherited base classes: FlowDataset with example: obj = KittiFlow(root, split, transforms)