model/mrcnn/wind_turbines_dataset.py
def load_mask(self, image_id):
        """Generate instance masks for an image.
       Returns:
        masks: A bool array of shape [height, width, instance count] with
            one mask per instance.
        class_ids: a 1D array of class IDs of the instance masks.
        """
        # If not a balloon dataset image, delegate to parent class.
        image_info = self.image_info[image_id]
        if image_info["source"] != "windturbines":
            return super(self.__class__, self).load_mask(image_id)

        # Convert polygons to a bitmap mask of shape
        # [height, width, instance_count]
        info = self.image_info[image_id]
        mask = np.zeros([info["height"], info["width"], len(info["centroids"])],  # prepared for multiple instances
                        dtype=np.uint8)
        for i, centroid in enumerate(info["centroids"]):
            # Get indexes of pixels inside the polygon and set them to 1
            rr, cc = skimage.draw.circle(centroid[0], centroid[1], 10)
            mask[rr, cc, i] = 1

        # Return mask, and array of class IDs of each instance. Since we have
        # one class ID only, we return an array of 1s

        return mask.astype(np.bool), np.ones([mask.shape[-1]], dtype=np.int32)
Generate instance masks for an image.
       Returns:
        masks: A bool array of shape [height, width, instance count] with
            one mask per instance.
        class_ids: a 1D array of class IDs of the instance masks.
        
Generate instance masks for an image.
Generate instance masks for an image .
def load_mask(self, image_id):
        image_info = self.image_info[image_id]
        if image_info["source"] != "windturbines":
            return super(self.__class__, self).load_mask(image_id)
        info = self.image_info[image_id]
        mask = np.zeros([info["height"], info["width"], len(info["centroids"])],  
                        dtype=np.uint8)
        for i, centroid in enumerate(info["centroids"]):
            rr, cc = skimage.draw.circle(centroid[0], centroid[1], 10)
            mask[rr, cc, i] = 1
        return mask.astype(np.bool), np.ones([mask.shape[-1]], dtype=np.int32)
def load_mask ( self , image_id ) : image_info = self . image_info [ image_id ] if image_info [ "source" ] != "windturbines" : return super ( self . __class__ , self ) . load_mask ( image_id ) info = self . image_info [ image_id ] mask = np . zeros ( [ info [ "height" ] , info [ "width" ] , len ( info [ "centroids" ] ) ] , dtype = np . uint8 ) for i , centroid in enumerate ( info [ "centroids" ] ) : rr , cc = skimage . draw . circle ( centroid [ 0 ] , centroid [ 1 ] , 10 ) mask [ rr , cc , i ] = 1 return mask . astype ( np . bool ) , np . ones ( [ mask . shape [ - 1 ] ] , dtype = np . int32 )
Generate instance masks for an image.
Generate instance masks for an image .
"""Generate instance masks for an image.
       Returns:
        masks: A bool array of shape [height, width, instance count] with
            one mask per instance.
        class_ids: a 1D array of class IDs of the instance masks.
        """ # If not a balloon dataset image, delegate to parent class. # Convert polygons to a bitmap mask of shape # [height, width, instance_count] # prepared for multiple instances # Get indexes of pixels inside the polygon and set them to 1 # Return mask, and array of class IDs of each instance. Since we have # one class ID only, we return an array of 1s
A bool array of shape [height, width, instance count] with
one mask per instance.
class_ids: a 1D array of class IDs of the instance masks.
A bool array of shape [ height width instance count ] with one mask per instance . class_ids : a 1D array of class IDs of the instance masks .
masks
self
image_id