Flickr8k¶
- class torchvision.datasets.Flickr8k(root: ~typing.Union[str, ~pathlib.Path], ann_file: str, transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]¶
Flickr8k Entities 資料集。
- 引數:
root (str 或
pathlib.Path) – 下載影像的根目錄。ann_file (string) – 註解檔案的路徑。
transform (callable, optional) – 一個函式/變換,根據給定的載入器接收 PIL 影像或 torch.Tensor,並返回變換後的版本。例如,
transforms.RandomCroptarget_transform (callable, optional) – 一個函式/變換,接收目標並對其進行變換。
loader (callable, optional) – 一個根據路徑載入影像的函式。預設情況下,它使用 PIL 作為影像載入器,但使用者也可以傳入
torchvision.io.decode_image以直接將影像資料解碼為張量。
- 特殊成員: