快捷方式

EuroSAT

class torchvision.datasets.EuroSAT(root: ~typing.Union[str, ~pathlib.Path], transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, download: bool = False, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[原始碼]

RGB 版本的 EuroSAT 資料集。

有關資料集的 MS 版本,請參閱 TorchGeo

引數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其中存在 root/eurosat

  • transform (callable, optional) – 一個函式/變換,接收 PIL 影像或 torch.Tensor(取決於給定的載入器),並返回一個變換後的版本。例如,transforms.RandomCrop

  • target_transform (可呼叫物件, 可選) – 一個函式/變換,接受目標並對其進行變換。

  • download (bool, optional) – 如果為 True,則從網際網路下載資料集並將其放入根目錄。如果資料集已下載,則不會再次下載。預設為 False。

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

特殊成員:

__getitem__(index: int) tuple[Any, Any]
引數:

index (int) – 索引

返回:

(sample, target),其中 target 是目標類的類索引。

返回型別:

元組

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源