pipelines/common_utils/lungmap_dataset.py
def load_data_set(self, data_set):
        """
        Load a data set.
        data_set: Dictionary of data, keys are image names, values are sub-regions
        """
        anatomy = set()

        for img_name, img_data in data_set.items():
            self.add_image(
                "lungmap",
                image_id=img_name,  # use file name as a unique image id
                img=cv2.cvtColor(img_data['hsv_img'], cv2.COLOR_HSV2RGB),
                width=img_data['hsv_img'].shape[0],
                height=img_data['hsv_img'].shape[1],
                polygons=img_data['regions']
            )
            for region in img_data['regions']:
                anatomy.add(region['label'])

        anatomy = sorted(list(anatomy))  # TODO: should this be sorted to ensure order?
        for i, a in enumerate(anatomy):
            self.add_class("lungmap", i+1, a)

        Load a data set.
        data_set: Dictionary of data, keys are image names, values are sub-regions
        
Load a data set.
data_set: Dictionary of data, keys are image names, values are sub-regions
Load a data set . data_set : Dictionary of data keys are image names values are sub - regions
def load_data_set(self, data_set):
        anatomy = set()
        for img_name, img_data in data_set.items():
            self.add_image(
                "lungmap",
                image_id=img_name,  
                img=cv2.cvtColor(img_data['hsv_img'], cv2.COLOR_HSV2RGB),
                width=img_data['hsv_img'].shape[0],
                height=img_data['hsv_img'].shape[1],
                polygons=img_data['regions']
            )
            for region in img_data['regions']:
                anatomy.add(region['label'])
        anatomy = sorted(list(anatomy))  
        for i, a in enumerate(anatomy):
            self.add_class("lungmap", i+1, a)
def load_data_set ( self , data_set ) : anatomy = set ( ) for img_name , img_data in data_set . items ( ) : self . add_image ( "lungmap" , image_id = img_name , img = cv2 . cvtColor ( img_data [ 'hsv_img' ] , cv2 . COLOR_HSV2RGB ) , width = img_data [ 'hsv_img' ] . shape [ 0 ] , height = img_data [ 'hsv_img' ] . shape [ 1 ] , polygons = img_data [ 'regions' ] ) for region in img_data [ 'regions' ] : anatomy . add ( region [ 'label' ] ) anatomy = sorted ( list ( anatomy ) ) for i , a in enumerate ( anatomy ) : self . add_class ( "lungmap" , i + 1 , a )
Load a data set.
Load a data set .
"""
        Load a data set.
        data_set: Dictionary of data, keys are image names, values are sub-regions
        """ # use file name as a unique image id # TODO: should this be sorted to ensure order?
self
data_set