SBU¶
- class torchvision.datasets.SBU(root: ~typing.Union[str, ~pathlib.Path], transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, download: bool = True, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]¶
SBU Caption Photo 資料集。
- 引數:
root (str 或
pathlib.Path) – 資料集根目錄,其中包含 tarballSBUCaptionedPhotoDataset.tar.gz。transform (可呼叫物件, 可選) – 一個函式/轉換,接受 PIL 影像或 torch.Tensor(取決於給定的載入器),並返回轉換後的版本。例如,
transforms.RandomCroptarget_transform (可呼叫物件, 可選) – 一個函式/轉換,接受目標並對其進行轉換。
download (bool, 可選) – 如果為 True,則從網際網路下載資料集並將其放入根目錄。如果資料集已下載,則不會再次下載。
loader (可呼叫物件, 可選) – 一個函式,給定影像路徑載入影像。預設情況下,它使用 PIL 作為影像載入器,但使用者也可以傳入
torchvision.io.decode_image以直接將影像資料解碼為張量。
- 特殊成員: