(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:
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:
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 :
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 = []
        self.image2hash = {}
        if not annotation_file == None:
            print('loading annotations into memory...')
            time_t = datetime.datetime.utcnow()
            dataset = json.load(open(annotation_file, 'r'))

            print( datetime.datetime.utcnow() - time_t)
            self.dataset = dataset
            self.createIndex()
def __init__ ( self , annotation_file = None ) : # load dataset self . dataset = { } self . anns = [ ] self . imgToAnns = { } self . catToImgs = { } self . imgs = [ ] self . cats = [ ] self . image2hash = { } if not annotation_file == None : print ( 'loading annotations into memory...' ) time_t = datetime . datetime . utcnow ( ) dataset = json . load ( open ( annotation_file , 'r' ) ) print ( datetime . datetime . utcnow ( ) - time_t ) self . dataset = dataset self . createIndex ( )