快捷方式

Sintel

class torchvision.datasets.Sintel(root: ~typing.Union[str, ~pathlib.Path], split: str = 'train', pass_name: str = 'clean', transforms: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]

Sintel 用於光流的資料集。

資料集應具有以下結構

root
    Sintel
        testing
            clean
                scene_1
                scene_2
                ...
            final
                scene_1
                scene_2
                ...
        training
            clean
                scene_1
                scene_2
                ...
            final
                scene_1
                scene_2
                ...
            flow
                scene_1
                scene_2
                ...
引數:
  • root (str or pathlib.Path) – Sintel 資料集的根目錄。

  • split (string, optional) – 資料集劃分,可以是 “train”(預設)或 “test”

  • pass_name (string, optional) – 要使用的 pass,可以是 “clean”(預設)、“final” 或 “both”。有關不同 passes 的詳細資訊,請參閱上面的連結。

  • transforms (callable, optional) – 一個函式/變換,它接收 img1, img2, flow, valid_flow_mask 並返回一個變換後的版本。valid_flow_mask 是為了與其他返回內建有效掩碼的資料集(如 KittiFlow)保持一致而期望提供的。

  • loader (callable, optional) – 給定影像路徑後加載影像的函式。預設情況下,它使用 PIL 作為影像載入器,但使用者也可以傳入 torchvision.io.decode_image 直接將影像資料解碼為張量。

特殊成員:

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

返回給定索引處的示例。

引數:

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

返回:

一個包含 (img1, img2, flow) 的 3 元組。flow 是一個形狀為 (2, H, W) 的 numpy 陣列,影像是 PIL 影像。如果 split="test",則 flow 為 None。如果在 transforms 引數中生成了有效的 flow 掩碼,則返回一個包含 (img1, img2, flow, valid_flow_mask) 的 4 元組。

返回型別:

tuple

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源