class_docstr: `Flickr8k Entities <http://hockenmaier.cs.illinois.edu/8k-pictures.html>`_ Dataset.
  
  Args:
      root (string): Root directory where images are downloaded to.
      ann_file (string): Path to annotation file.
      transform (callable, optional): A function/transform that takes in a PIL image
          and returns a transformed version. E.g, ``transforms.PILToTensor``
      target_transform (callable, optional): A function/transform that takes in the
          target and transforms it.
code: def __init__(
      self,
      root: str,
      ann_file: str,
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
  ) -> None:
      super().__init__(
          root, transform=transform, target_transform=target_transform
      )
      self.ann_file = os.path.expanduser(ann_file)
  
      # Read annotations and store in a dict
      parser = Flickr8kParser(self.root)
      with open(self.ann_file) as fh:
          parser.feed(fh.read())
      self.annotations = parser.annotations
  
      self.ids = list(sorted(self.annotations.keys()))
  
imports: import glob
  import os
  from collections import defaultdict
  from html.parser import HTMLParser
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from PIL import Image
  from .vision import VisionDataset
label_desc: Use image node_id 1 to create a new Flickr8k object from inherited base classes: VisionDataset with example: obj = Flickr8k(root, ann_file, transform, target_transform)