快捷方式

ETH3DStereo

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

ETH3D 低解析度雙檢視 資料集。

資料集結構應如下所示

root
    ETH3D
        two_view_training
            scene1
                im1.png
                im0.png
                images.txt
                cameras.txt
                calib.txt
            scene2
                im1.png
                im0.png
                images.txt
                cameras.txt
                calib.txt
            ...
        two_view_training_gt
            scene1
                disp0GT.pfm
                mask0nocc.png
            scene2
                disp0GT.pfm
                mask0nocc.png
            ...
        two_view_testing
            scene1
                im1.png
                im0.png
                images.txt
                cameras.txt
                calib.txt
            scene2
                im1.png
                im0.png
                images.txt
                cameras.txt
                calib.txt
            ...
引數
  • root (str 或 pathlib.Path) – ETH3D 資料集的根目錄。

  • split (string, 可選的) – 場景的資料集劃分,可以是“train”(預設)或“test”。

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

特殊成員

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

返回給定索引處的樣本。

引數

index (int) – 要檢索的樣本索引

返回值

一個包含 (img_left, img_right, disparity, valid_mask) 的 4 元組。disparity 是一個形狀為 (1, H, W) 的 numpy 陣列,影像是 PIL 影像。valid_masktransforms 引數未生成有效掩碼時隱式為 None。如果資料集劃分是 test,則 disparityvalid_mask 都為 None

返回型別

tuple

文件

查閱 PyTorch 全面開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源