捷徑

Sintel

class torchvision.datasets.Sintel(root: Union[str, Path], split: str = 'train', pass_name: str = 'clean', transforms: Optional[Callable] = None)[來源]

用於光流的 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 或 pathlib.Path) – Sintel 資料集的根目錄。

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

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

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

特殊成員:

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

傳回指定索引的範例。

參數:

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

Returns:

一個 3-tuple,包含 (img1, img2, flow)。 flow 是一個形狀為 (2, H, W) 的 numpy 陣列,而 images 是 PIL images。 如果 split="test",則 flow 為 None。 如果在 transforms 參數中產生有效的 flow 遮罩,則傳回一個包含 (img1, img2, flow, valid_flow_mask) 的 4-tuple。

Return type:

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