FakeData¶
- class torchvision.datasets.FakeData(size: int = 1000, image_size: Tuple[int, int, int] = (3, 224, 224), num_classes: int = 10, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, random_offset: int = 0)[source]¶
一個返回隨機生成影像的假資料集,並將其作為 PIL 影像返回
- 引數:
size (int, optional) – 資料集的大小。預設為 1000 張影像
image_size (tuple, optional) – 返回影像的大小。預設為 (3, 224, 224)
num_classes (int, optional) – 資料集中的類別數量。預設為 10
transform (callable, optional) – 一個函式/變換,接收 PIL 影像並返回變換後的版本。例如,
transforms.RandomCroptarget_transform (callable, optional) – 一個函式/變換,接收目標並對其進行變換。
random_offset (int) – 用於生成每張影像的基於索引的隨機種子的偏移量。預設為 0
使用
FakeData的示例- 特殊成員: