快捷方式

FlyingChairs

class torchvision.datasets.FlyingChairs(root: Union[str, Path], split: str = 'train', transforms: Optional[Callable] = None)[source]

FlyingChairs 光流的資料集。

您還需要從資料集頁面下載 FlyingChairs_train_val.txt 檔案。

預期資料集具有以下結構

root
    FlyingChairs
        data
            00001_flow.flo
            00001_img1.ppm
            00001_img2.ppm
            ...
        FlyingChairs_train_val.txt
參數:
  • root (str 或 pathlib.Path) – FlyingChairs 資料集的根目錄。

  • split (字串, 選用) – 資料集分割,可以是 “train” (預設) 或 “val”

  • transforms (callable, 選用) – 接收 img1、 img2、 flow、 valid_flow_mask 並傳回轉換版本的函式/轉換。valid_flow_mask 預期與其他傳回內建模有效遮罩的資料集保持一致,例如 KittiFlow

特殊成員:

__getitem__(index: int) Union[Tuple[Image, Image, Optional[ndarray], Optional[ndarray]], Tuple[Image, Image, Optional[ndarray]]][source]

傳回給定索引的範例。

參數:

index (int) – 要擷取的範例索引

傳回:

一個包含 (img1, img2, flow) 的三元組。 flow 是一個形狀為 (2, H, W) 的 numpy 陣列,而 images 是 PIL 影像。如果 split="val",則 flow 為 None。如果在 transforms 參數中產生有效的 flow mask,則傳回包含 (img1, img2, flow, valid_flow_mask) 的四元組。

傳回類型:

tuple

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources