towhee.data.dataset.image_datasets.PyTorchImageDataset

class towhee.data.dataset.image_datasets.PyTorchImageDataset(image_path: str, label_file: str, data_transform: Optional[Compose] = None)[source]

Bases: Dataset

PyTorchImageDataset is a dataset class for training.

Parameters:
  • image_path (str) – Path to the images for your dataset.

  • label_file (str) – Path to your label file. The label file should be a csv file. The columns in this file should be [image_name, category], ‘image_name’ is the path of your images, ‘category’ is the label of accordance image. For example: [image_name, dog] for one row. Note that the first row should be[image_name, category]

  • data_transform (Compose) – PyTorch transform of the input images.

Methods

__init__(image_path: str, label_file: str, data_transform: Optional[Compose] = None)[source]