(self, imgIds=[], catIds=[], areaRng=[], iscrowd=None)
return ids
Get ann ids that satisfy given filter conditions. default skips that filter
        :param imgIds  (int array)     : get anns for given imgs
               catIds  (int array)     : get anns for given cats
               areaRng (float array)   : get anns for given area range (e.g. [0 inf])
               iscrowd (boolean)       : get anns for given crowd label (False or True)
        :return: ids (int array)       : integer array of ann ids
Get ann ids that satisfy given filter conditions. default skips that filter
        :param imgIds  (int array)     : get anns for given imgs
               catIds  (int array)     : get anns for given cats
               areaRng (float array)   : get anns for given area range (e.g. [0 inf])
               iscrowd (boolean)       : get anns for given crowd label (False or True)
        :return: ids (int array)       : integer array of ann ids
Get ann ids that satisfy given filter conditions . default skips that filter : param imgIds ( int array ) : get anns for given imgs catIds ( int array ) : get anns for given cats areaRng ( float array ) : get anns for given area range ( e . g . [ 0 inf ] ) iscrowd ( boolean ) : get anns for given crowd label ( False or True ) : return : ids ( int array ) : integer array of ann ids
def getAnnIds(self, imgIds=[], catIds=[], areaRng=[], iscrowd=None):
        """
        Get ann ids that satisfy given filter conditions. default skips that filter
        :param imgIds  (int array)     : get anns for given imgs
               catIds  (int array)     : get anns for given cats
               areaRng (float array)   : get anns for given area range (e.g. [0 inf])
               iscrowd (boolean)       : get anns for given crowd label (False or True)
        :return: ids (int array)       : integer array of ann ids
        """
        imgIds = imgIds if type(imgIds) == list else [imgIds]
        catIds = catIds if type(catIds) == list else [catIds]

        if len(imgIds) == len(catIds) == len(areaRng) == 0:
            anns = self.dataset['annotations']
        else:
            if not len(imgIds) == 0:
                anns = sum([self.imgToAnns[imgId] for imgId in imgIds if imgId in self.imgToAnns],[])
            else:
                anns = self.dataset['annotations']
            anns = anns if len(catIds)  == 0 else [ann for ann in anns if ann['category_id'] in catIds]
            anns = anns if len(areaRng) == 0 else [ann for ann in anns if ann['area'] > areaRng[0] and ann['area'] < areaRng[1]]
        if self.dataset['type'] == 'instances':
            if not iscrowd == None:
                ids = [ann['id'] for ann in anns if ann['iscrowd'] == iscrowd]
            else:
                ids = [ann['id'] for ann in anns]
        else:
            ids = [ann['id'] for ann in anns]
        return ids
def getAnnIds ( self , imgIds = [ ] , catIds = [ ] , areaRng = [ ] , iscrowd = None ) : imgIds = imgIds if type ( imgIds ) == list else [ imgIds ] catIds = catIds if type ( catIds ) == list else [ catIds ] if len ( imgIds ) == len ( catIds ) == len ( areaRng ) == 0 : anns = self . dataset [ 'annotations' ] else : if not len ( imgIds ) == 0 : anns = sum ( [ self . imgToAnns [ imgId ] for imgId in imgIds if imgId in self . imgToAnns ] , [ ] ) else : anns = self . dataset [ 'annotations' ] anns = anns if len ( catIds ) == 0 else [ ann for ann in anns if ann [ 'category_id' ] in catIds ] anns = anns if len ( areaRng ) == 0 else [ ann for ann in anns if ann [ 'area' ] > areaRng [ 0 ] and ann [ 'area' ] < areaRng [ 1 ] ] if self . dataset [ 'type' ] == 'instances' : if not iscrowd == None : ids = [ ann [ 'id' ] for ann in anns if ann [ 'iscrowd' ] == iscrowd ] else : ids = [ ann [ 'id' ] for ann in anns ] else : ids = [ ann [ 'id' ] for ann in anns ] return ids