class_docstr: ImageDatabase can be used to load images in MMF.
  This goes either in conjunction with AnnotationDatabase or
  can be separately used with function such as `from_path`.
  MMFDataset initializes its own copy of ImageDatabase if `use_images`
  is True. Rest everything works same as a normal torch Dataset if
  you pass the annotation_db as a parameter. For example for item
  1 from annotation db, you can pass same id to ImageDatabase to loads
  its image. If you don't pass it, you have two options. Either use
  .get which takes in an annotation db item or .from_path which directly
  takes in an image path. You are free to use your own dataset instead
  of image database or free to update or ignore MMFDataset's ImageDataset
  initialization. You can either reinitialize with transform and other
  params or use any of torchvision's datasets.
docstr: Initialize an instance of ImageDatabase
  
  Args:
      torch ([type]): [description]
      config (DictConfig): Config object from dataset_config
      path (str): Path to images folder
      annotation_db (AnnotationDB, optional): Annotation DB to be used
          to be figure out image paths. Defaults to None.
      transform (callable, optional): Transform to be called upon loaded image.
          Defaults to None.
      loader (callable, optional): Custom loader for image which given a path
          returns a PIL Image. Defaults to torchvision's default loader.
      is_valid_file (callable, optional): Custom callable to filter out invalid
          files. If image is invalid, {"images": []} will returned which you can
          filter out in your dataset. Defaults to None.
      image_key (str, optional): Key that points to image path in annotation db.
          If not specified, ImageDatabase will make some intelligent guesses
          about the possible key. Defaults to None.
docstr_tok: ["Initialize","an","instance","of","ImageDatabase","Args",":","torch","(","[","type","]",")",":","[","description","]","config","(","DictConfig",")",":","Config","object","from","dataset_config","path","(","str",")",":","Path","to","images","folder","annotation_db","(","AnnotationDB",",","optional",")",":","Annotation","DB","to","be","used","to","be","figure","out","image","paths",".","Defaults","to","None",".","transform","(","callable",",","optional",")",":","Transform","to","be","called","upon","loaded","image",".","Defaults","to","None",".","loader","(","callable",",","optional",")",":","Custom","loader","for","image","which","given","a","path","returns","a","PIL","Image",".","Defaults","to","torchvision","'s","default","loader",".","is_valid_file","(","callable",",","optional",")",":","Custom","callable","to","filter","out","invalid","files",".","If","image","is","invalid",",","{","``","images","''",":","[","]","}","will","returned","which","you","can","filter","out","in","your","dataset",".","Defaults","to","None",".","image_key","(","str",",","optional",")",":","Key","that","points","to","image","path","in","annotation","db",".","If","not","specified",",","ImageDatabase","will","make","some","intelligent","guesses","about","the","possible","key",".","Defaults","to","None","."]
code: def __init__(
      self,
      config,
      path,
      annotation_db=None,
      transform=None,
      loader=default_loader,
      is_valid_file=None,
      image_key=None,
      *args,
      **kwargs,
  ):
      """Initialize an instance of ImageDatabase
  
      Args:
          torch ([type]): [description]
          config (DictConfig): Config object from dataset_config
          path (str): Path to images folder
          annotation_db (AnnotationDB, optional): Annotation DB to be used
              to be figure out image paths. Defaults to None.
          transform (callable, optional): Transform to be called upon loaded image.
              Defaults to None.
          loader (callable, optional): Custom loader for image which given a path
              returns a PIL Image. Defaults to torchvision's default loader.
          is_valid_file (callable, optional): Custom callable to filter out invalid
              files. If image is invalid, {"images": []} will returned which you can
              filter out in your dataset. Defaults to None.
          image_key (str, optional): Key that points to image path in annotation db.
              If not specified, ImageDatabase will make some intelligent guesses
              about the possible key. Defaults to None.
      """
      super().__init__()
      self.config = config
      self.base_path = get_absolute_path(path)
      self.transform = transform
      self.annotation_db = annotation_db
      self.loader = loader
      self.image_key = config.get("image_key", None)
      self.image_key = image_key if image_key else self.image_key
      self.is_valid_file = is_valid_file
  
imports: import collections
  import os
  import torch
  import torchvision
  import torchvision.datasets.folder
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
  from PIL import Image
label_desc: Use image node_id 1 to create a new ImageDatabase object from inherited base classes: torch.utils.data with example: obj = ImageDatabase(config, path, annotation_db, transform, loader, is_valid_file, image_key)