lib/datasets/display.py
def _load_display_annotation(self, index):
        """
        Loads Display bounding-box instance annotations. Crowd instances are
        handled by marking their overlaps (with all categories) to -1. This
        overlap value means that crowd "instances" are excluded from training.
        """

        annotation_file = os.path.join(
            self._data_path, 'annotations/instances_{}.txt'.format(self._image_set))
        assert os.path.isfile(annotation_file), annotation_file

        txt_annotations = open(annotation_file, 'r')
        annotations = txt_annotations.readlines()

        num_objs = 3
        boxes = np.zeros((num_objs, 4), dtype=np.uint16)
        gt_classes = np.zeros((num_objs), dtype=np.int32)
        overlaps = np.zeros((num_objs, self.num_classes), dtype=np.float32)
        seg_areas = np.zeros((num_objs), dtype=np.float32)
        width, height = 0, 0

        for i in range(0, len(annotations), 3):
            if i != index:
                continue
            temp = annotations[i].split(',')
            
            # data in ground truth file has 3 line for each img
            for j in range(0, 3):
                temp = annotations[i + j].split(',')
                x1 = int(temp[1]) 
                y1 = int(temp[2])  
                x2 = int(temp[3]) 
                y2 = int(temp[4]) 
                width = x2 - x1
                height = y2 - y1
                box = [x1, y1, x2, y2] 
                boxes[j, :] = box
                gt_classes[j] = int(temp[5][0]) + 1
                seg_areas[j] = (x2 - x1) * (y2 - y1)
                overlaps[j, int(temp[5][0]) + 1] = 1.0
        print("===================[display.py:173] ", overlaps)
        ds_utils.validate_boxes(boxes, width=width, height=height)
        overlaps = scipy.sparse.csr_matrix(overlaps)
        print("===================[display.py:173] ", overlaps)

        return {'width': width,
            'height': height,
            'boxes': boxes,
            'gt_classes': gt_classes,
            'gt_overlaps': overlaps,
            'flipped': False,
            'seg_areas': seg_areas}

        Loads Display bounding-box instance annotations. Crowd instances are
        handled by marking their overlaps (with all categories) to -1. This
        overlap value means that crowd "instances" are excluded from training.
        
Loads Display bounding-box instance annotations. Crowd instances are
handled by marking their overlaps (with all categories) to -1. This
overlap value means that crowd "instances" are excluded from training.
Loads Display bounding - box instance annotations . Crowd instances are handled by marking their overlaps ( with all categories ) to - 1 . This overlap value means that crowd " instances " are excluded from training .
def _load_display_annotation(self, index):
        annotation_file = os.path.join(
            self._data_path, 'annotations/instances_{}.txt'.format(self._image_set))
        assert os.path.isfile(annotation_file), annotation_file
        txt_annotations = open(annotation_file, 'r')
        annotations = txt_annotations.readlines()
        num_objs = 3
        boxes = np.zeros((num_objs, 4), dtype=np.uint16)
        gt_classes = np.zeros((num_objs), dtype=np.int32)
        overlaps = np.zeros((num_objs, self.num_classes), dtype=np.float32)
        seg_areas = np.zeros((num_objs), dtype=np.float32)
        width, height = 0, 0
        for i in range(0, len(annotations), 3):
            if i != index:
                continue
            temp = annotations[i].split(',')
            for j in range(0, 3):
                temp = annotations[i + j].split(',')
                x1 = int(temp[1]) 
                y1 = int(temp[2])  
                x2 = int(temp[3]) 
                y2 = int(temp[4]) 
                width = x2 - x1
                height = y2 - y1
                box = [x1, y1, x2, y2] 
                boxes[j, :] = box
                gt_classes[j] = int(temp[5][0]) + 1
                seg_areas[j] = (x2 - x1) * (y2 - y1)
                overlaps[j, int(temp[5][0]) + 1] = 1.0
        print("===================[display.py:173] ", overlaps)
        ds_utils.validate_boxes(boxes, width=width, height=height)
        overlaps = scipy.sparse.csr_matrix(overlaps)
        print("===================[display.py:173] ", overlaps)
        return {'width': width,
            'height': height,
            'boxes': boxes,
            'gt_classes': gt_classes,
            'gt_overlaps': overlaps,
            'flipped': False,
            'seg_areas': seg_areas}
def _load_display_annotation ( self , index ) : annotation_file = os . path . join ( self . _data_path , 'annotations/instances_{}.txt' . format ( self . _image_set ) ) assert os . path . isfile ( annotation_file ) , annotation_file txt_annotations = open ( annotation_file , 'r' ) annotations = txt_annotations . readlines ( ) num_objs = 3 boxes = np . zeros ( ( num_objs , 4 ) , dtype = np . uint16 ) gt_classes = np . zeros ( ( num_objs ) , dtype = np . int32 ) overlaps = np . zeros ( ( num_objs , self . num_classes ) , dtype = np . float32 ) seg_areas = np . zeros ( ( num_objs ) , dtype = np . float32 ) width , height = 0 , 0 for i in range ( 0 , len ( annotations ) , 3 ) : if i != index : continue temp = annotations [ i ] . split ( ',' ) for j in range ( 0 , 3 ) : temp = annotations [ i + j ] . split ( ',' ) x1 = int ( temp [ 1 ] ) y1 = int ( temp [ 2 ] ) x2 = int ( temp [ 3 ] ) y2 = int ( temp [ 4 ] ) width = x2 - x1 height = y2 - y1 box = [ x1 , y1 , x2 , y2 ] boxes [ j , : ] = box gt_classes [ j ] = int ( temp [ 5 ] [ 0 ] ) + 1 seg_areas [ j ] = ( x2 - x1 ) * ( y2 - y1 ) overlaps [ j , int ( temp [ 5 ] [ 0 ] ) + 1 ] = 1.0 print ( "===================[display.py:173] " , overlaps ) ds_utils . validate_boxes ( boxes , width = width , height = height ) overlaps = scipy . sparse . csr_matrix ( overlaps ) print ( "===================[display.py:173] " , overlaps ) return { 'width' : width , 'height' : height , 'boxes' : boxes , 'gt_classes' : gt_classes , 'gt_overlaps' : overlaps , 'flipped' : False , 'seg_areas' : seg_areas }
Loads Display bounding-box instance annotations.
Loads Display bounding - box instance annotations .
"""
        Loads Display bounding-box instance annotations. Crowd instances are
        handled by marking their overlaps (with all categories) to -1. This
        overlap value means that crowd "instances" are excluded from training.
        """ # data in ground truth file has 3 line for each img
self
index