class_docstr: ## Carvana Dataset
docstr: #### Get an image and its mask.
  
  :param idx: is index of the image
docstr_tok: ["#","#","#","#","Get","an","image","and","its","mask",".",":","param","idx",":","is","index","of","the","image"]
code: def __getitem__(self, idx: int):
      """
      #### Get an image and its mask.
  
      :param idx: is index of the image
      """
  
      # Get image id
      id_ = self.ids[idx]
      # Load image
      image = Image.open(self.images[id_])
      # Transform image and convert it to a PyTorch tensor
      image = self.transforms(image)
      # Load mask
      mask = Image.open(self.masks[id_])
      # Transform mask and convert it to a PyTorch tensor
      mask = self.transforms(mask)
  
      # The mask values were not $1$, so we scale it appropriately.
      mask = mask / mask.max()
  
      # Return the image and the mask
      return image, mask
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/unet/carvana.py
imports: from torch import nn
  from pathlib import Path
  import torch.utils.data
  import torchvision.transforms.functional
  from PIL import Image
  from labml import lab
label_desc: Use image node_id 2 for calling the CarvanaDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: image,  mask