(self, segmentations, segmodel, num=None, label=None)
return segviz.segment_key(segmentations, segmodel, num)
Obtains a list of the top segment labels present in the given
        segmetation tensor, for use in a legend.
Obtains a list of the top segment labels present in the given
        segmetation tensor, for use in a legend.
Obtains a list of the top segment labels present in the given segmetation tensor for use in a legend .
def segment_key(self, segmentations, segmodel, num=None, label=None):
        '''
        Obtains a list of the top segment labels present in the given
        segmetation tensor, for use in a legend.
        '''
        if label is not None:
            segmentations = segmentations.clone()
            segmentations[segmentations != label] = 0
        if num is None:
            num = self.size[0] // 17
        return segviz.segment_key(segmentations, segmodel, num)
def segment_key ( self , segmentations , segmodel , num = None , label = None ) : if label is not None : segmentations = segmentations . clone ( ) segmentations [ segmentations != label ] = 0 if num is None : num = self . size [ 0 ] // 17 return segviz . segment_key ( segmentations , segmodel , num )