快捷方式

SceneFlowStereo

class torchvision.datasets.SceneFlowStereo(root: Union[str, Path], variant: str = 'FlyingThings3D', pass_name: str = 'clean', transforms: Optional[Callable] = None)[source]

適用於 Scene Flow 資料集的介面。此介面提供對 FlyingThings3D、MonkaaDriving 資料集的訪問。

資料集應具有以下結構

root
    SceneFlow
        Monkaa
            frames_cleanpass
                scene1
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
                scene2
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
            frames_finalpass
                scene1
                    left
                        img1.png
                        img2.png
                    right
                        img1.png
                        img2.png
                ...
                ...
            disparity
                scene1
                    left
                        img1.pfm
                        img2.pfm
                    right
                        img1.pfm
                        img2.pfm
        FlyingThings3D
            ...
            ...
引數:
  • root (str 或 pathlib.Path) – SceneFlow 所在的根目錄。

  • variant (string) – 要使用的資料集變體,包括 “FlyingThings3D”(預設)、“Monkaa” 或 “Driving”。

  • pass_name (string) – 要使用的通道,包括 “clean”(預設)、“final” 或 “both”。

  • transforms (callable, optional) – 一個函式/變換,它接收一個樣本並返回其變換後的版本。

特殊成員:

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

返回給定索引處的示例。

引數:

index (int) – 要檢索的示例的索引

返回值:

一個包含 (img_left, img_right, disparity) 的 3 元組。視差是一個形狀為 (1, H, W) 的 numpy 陣列,影像是 PIL 影像。如果在 transforms 引數中生成了 valid_mask,則返回一個包含 (img_left, img_right, disparity, valid_mask) 的 4 元組。

返回型別:

tuple

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源