class_docstr: Dataset for image classification tasks
class_docstr_tok: ["Dataset","for","image","classification","tasks"]
code: def __getitem__(self, index):
      image = self.read_image(self.images[index])
      data = self.transform(image=image)
  
      image = data["image"]
  
      sample = {
          INPUT_INDEX_KEY: index,
          INPUT_IMAGE_ID_KEY: self.image_ids[index],
          INPUT_IMAGE_KEY: image_to_tensor(image),
      }
  
      if self.labels is not None:
          sample[TARGET_CLASS_KEY] = self.make_target(
              self.labels[index]
          )
      return sample
  
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 3 for calling the ClassificationDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: sample