Creates a dataset for image classification. Single and multi label classification is supported.

Creating a data-set for a classification or segmentation task. If an annotation file is present, the annotations are also prepared. The data-set is created based on an image-set.

Image-Set

Image-sets are collected images to build a data-set from, stored in the imagesets folder. The imagesets folder contains the following folder structure:

  • imagesets/[image_set_type]/[image_set_name]

Inside the [image_set_name] folder are the following files / folders

  • test/: test images (benchmark)
  • trainval/: training and validation images for cross validation
  • categories.txt: all categories (classes) the image-set contains

Data-Set Folders

Data-sets are stored in the datasets base folder. The datasets folder contains the following folder structure:

  • datasets/[data_set_type]/[data_set_name] where [data_set_type] is the same as the corresponding [image_set_type] and [data_set_name] is the same as the corresponding [image_set_name].

Inside the [data_set_name] folder are the following files / folders

  • test/: test set (benchmark)
  • train/: training set
  • val/: validation set
  • categories.txt: all categories (classes) the data-set contains

Create a classification data-set

Classification data-set can be created from a classification image-set. All images are validated, if they belong to one of the given categories. If categories with no images are found or images belong to a category not listed in categories.txt, the data-set can not be created.

class ImageClassificationDataset[source]

ImageClassificationDataset(input_adapter:AnnotationAdapter, output_adapter:AnnotationAdapter, split=None, seed=None, sample=None, tfrecord=False) :: Dataset

Classification dataset.