class_docstr: COCO Custom Dataset compatible with torch.utils.data.DataLoader.
class_docstr_tok: ["COCO","Custom","Dataset","compatible","with","torch.utils.data.DataLoader","."]
docstr: Set the path for images, captions and vocabulary wrapper.
  
  Args:
      root: image directory.
      json: coco annotation file path.
      vocab: vocabulary wrapper.
      transform: image transformer.
docstr_tok: ["Set","the","path","for","images",",","captions","and","vocabulary","wrapper",".","Args",":","root",":","image","directory",".","json",":","coco","annotation","file","path",".","vocab",":","vocabulary","wrapper",".","transform",":","image","transformer","."]
code: def __init__(self, root, json, vocab, transform=None):
      """Set the path for images, captions and vocabulary wrapper.
  
      Args:
          root: image directory.
          json: coco annotation file path.
          vocab: vocabulary wrapper.
          transform: image transformer.
      """
      self.root = root
      self.coco = COCO(json)
      self.ids = list(self.coco.anns.keys())
      self.vocab = vocab
      self.transform = transform
  
file_path: pytorch-tutorial/tutorials/03-advanced/image_captioning/data_loader.py
imports: import torch
  import torchvision.transforms
  import torch.utils.data
  import os
  import pickle
  import numpy
  import nltk
  from PIL import Image
  from build_vocab import Vocabulary
  from pycocotools.coco import COCO
label_desc: Use image node_id 1 to create a new CocoDataset object from inherited base classes: data with example: obj = CocoDataset(root, json, vocab, transform)