timm 文档

数据

Hugging Face's logo
加入 Hugging Face 社区

并获得增强文档体验

开始

数据

timm.data.create_dataset

< >

( name: str root: 可选 = None split: str = 'validation' search_split: bool = True class_map: dict = None load_bytes: bool = False is_training: bool = False download: bool = False batch_size: int = 1 num_samples: 可选 = None seed: int = 42 repeats: int = 0 input_img_mode: str = 'RGB' **kwargs )

数据集工厂方法

每个参数后面的括号中列出了每个参数支持的数据集类型,其中之一为

  • folder - 默认,基于 timm 文件夹(或 tar)的 ImageDataset
  • torch - 基于 torchvision 的数据集
  • HFDS - Hugging Face 数据集
  • TFDS - 通过 IterableImageDataset 在 IterabeDataset 接口中包装的 Tensorflow-datasets
  • WDS - Webdataset
  • all - 以上任意一种

timm.data.create_loader

< >

( dataset: Union input_size: Union batch_size: int is_training: bool = False no_aug: bool = False re_prob: float = 0.0 re_mode: str = 'const' re_count: int = 1 re_split: bool = False train_crop_mode: Optional = None scale: Optional = None ratio: Optional = None hflip: float = 0.5 vflip: float = 0.0 color_jitter: float = 0.4 color_jitter_prob: Optional = None grayscale_prob: float = 0.0 gaussian_blur_prob: float = 0.0 auto_augment: Optional = None num_aug_repeats: int = 0 num_aug_splits: int = 0 interpolation: str = 'bilinear' mean: Tuple = (0.485, 0.456, 0.406) std: Tuple = (0.229, 0.224, 0.225) num_workers: int = 1 distributed: bool = False crop_pct: Optional = None crop_mode: Optional = None crop_border_pixels: Optional = None collate_fn: Optional = None pin_memory: bool = False fp16: bool = False img_dtype: dtype = torch.float32 device: device = device(type='cuda') use_prefetcher: bool = True use_multi_epochs_loader: bool = False persistent_workers: bool = True worker_seeding: str = 'all' tf_preprocessing: bool = False )

timm.data.create_transform

< >

( input_size: Union = 224 is_training: bool = False no_aug: bool = False train_crop_mode: Optional = None scale: Optional = None ratio: Optional = None hflip: float = 0.5 vflip: float = 0.0 color_jitter: Union = 0.4 color_jitter_prob: Optional = None grayscale_prob: float = 0.0 gaussian_blur_prob: float = 0.0 auto_augment: Optional = None interpolation: str = 'bilinear' mean: Tuple = (0.485, 0.456, 0.406) std: Tuple = (0.229, 0.224, 0.225) re_prob: float = 0.0 re_mode: str = 'const' re_count: int = 1 re_num_splits: int = 0 crop_pct: Optional = None crop_mode: Optional = None crop_border_pixels: Optional = None tf_preprocessing: bool = False use_prefetcher: bool = False normalize: bool = True separate: bool = False )

timm.data.resolve_data_config

< >

( args = None pretrained_cfg = None model = None use_test_size = False verbose = False )

< > 在 GitHub 上更新