SegMitos_train/mitos_layers_ring.py
def load_label(self, idx):
        """
        Load label image as 1 x height x width integer array of label indices.
        The leading singleton dimension is required by the loss.
        """
        im = Image.open('{}/augImg_gt_ring_random/{}/{}.png'.format(self.mitos_dir, self.label_dir, idx))
        label = np.array(im, dtype=np.uint8)      
        for i in range(label.shape[0]):
            for j in range(label.shape[1]):
                if label[i][j]<160 and label[i][j]>0:                    
                    label[i][j]=255
                elif label[i][j]>=160:
                    label[i][j]=1
                

        label = label[np.newaxis, ...]
        return label

        Load label image as 1 x height x width integer array of label indices.
        The leading singleton dimension is required by the loss.
        
Load label image as 1 x height x width integer array of label indices.
The leading singleton dimension is required by the loss.
Load label image as 1 x height x width integer array of label indices . The leading singleton dimension is required by the loss .
def load_label(self, idx):
        im = Image.open('{}/augImg_gt_ring_random/{}/{}.png'.format(self.mitos_dir, self.label_dir, idx))
        label = np.array(im, dtype=np.uint8)      
        for i in range(label.shape[0]):
            for j in range(label.shape[1]):
                if label[i][j]<160 and label[i][j]>0:                    
                    label[i][j]=255
                elif label[i][j]>=160:
                    label[i][j]=1
        label = label[np.newaxis, ...]
        return label
def load_label ( self , idx ) : im = Image . open ( '{}/augImg_gt_ring_random/{}/{}.png' . format ( self . mitos_dir , self . label_dir , idx ) ) label = np . array ( im , dtype = np . uint8 ) for i in range ( label . shape [ 0 ] ) : for j in range ( label . shape [ 1 ] ) : if label [ i ] [ j ] < 160 and label [ i ] [ j ] > 0 : label [ i ] [ j ] = 255 elif label [ i ] [ j ] >= 160 : label [ i ] [ j ] = 1 label = label [ np . newaxis , ... ] return label
Load label image as 1 x height x width integer array of label indices.
Load label image as 1 x height x width integer array of label indices .
"""
        Load label image as 1 x height x width integer array of label indices.
        The leading singleton dimension is required by the loss.
        """
self
idx