parameters: (self, annotation_file=None)
docstring: Constructor of Microsoft COCO helper class for reading and visualizing annotations.
          :param annotation_file (str): location of annotation file
          :param image_folder (str): location to the folder that hosts images.
          :return:
docstring_summary: Constructor of Microsoft COCO helper class for reading and visualizing annotations.
          :param annotation_file (str): location of annotation file
          :param image_folder (str): location to the folder that hosts images.
          :return:
docstring_tokens: Constructor of Microsoft COCO helper class for reading and visualizing annotations . : param annotation_file ( str ) : location of annotation file : param image_folder ( str ) : location to the folder that hosts images . : return :
function: def __init__(self, annotation_file=None):
          """
          Constructor of Microsoft COCO helper class for reading and visualizing annotations.
          :param annotation_file (str): location of annotation file
          :param image_folder (str): location to the folder that hosts images.
          :return:
          """
          # load dataset
          self.dataset = {}
          self.anns = []
          self.imgToAnns = {}
          self.catToImgs = {}
          self.imgs = {}
          self.cats = {}
          if not annotation_file == None:
              print 'loading annotations into memory...'
              tic = time.time()
              dataset = json.load(open(annotation_file, 'r'))
              print 'Done (t=%0.2fs)'%(time.time()- tic)
              self.dataset = dataset
              self.createIndex()
function_tokens: def __init__ ( self , annotation_file = None ) : # load dataset self . dataset = { } self . anns = [ ] self . imgToAnns = { } self . catToImgs = { } self . imgs = { } self . cats = { } if not annotation_file == None : print 'loading annotations into memory...' tic = time . time ( ) dataset = json . load ( open ( annotation_file , 'r' ) ) print 'Done (t=%0.2fs)' % ( time . time ( ) - tic ) self . dataset = dataset self . createIndex ( )