class_docstr: Dataset for image classification tasks
class_docstr_tok: ["Dataset","for","image","classification","tasks"]
code: def __init__(
      self,
      image_filenames: List[str],
      labels: Optional[Union[List[int], np.ndarray]],
      transform: A.Compose,
      read_image_fn: Callable = read_image_rgb,
      make_target_fn: Callable = label_to_tensor,
  ):
      if labels is not None and len(image_filenames) != len(labels):
          raise ValueError(
              "Number of images does not corresponds to number of targets"
          )
  
      self.image_ids = [
          fs.id_from_fname(fname) for fname in image_filenames
      ]
      self.labels = labels
      self.images = image_filenames
      self.read_image = read_image_fn
      self.transform = transform
      self.make_target = make_target_fn
  
file_path: pytorch-toolbelt/pytorch_toolbelt/datasets/classification.py
imports: from typing import Optional, List, Union, Callable
  import albumentations
  import numpy
  import torch
  from torch.utils.data import Dataset
  from .common import read_image_rgb, INPUT_IMAGE_KEY, INPUT_IMAGE_ID_KEY, INPUT_INDEX_KEY, TARGET_CLASS_KEY
  from ..utils import fs, image_to_tensor
label_desc: Use image node_id 1 to create a new ClassificationDataset object from inherited base classes: Dataset with example: obj = ClassificationDataset(image_filenames, labels, transform, read_image_fn, make_target_fn)