(self, matrix)
return match_indices, labels
matrix(tensor): A two dim tensor with shape of (N, M). N is number of GT-boxes,
            while M is the number of anchors in detection.
matrix(tensor): A two dim tensor with shape of (N, M). N is number of GT-boxes,
            while M is the number of anchors in detection.
matrix ( tensor ) : A two dim tensor with shape of ( N M ) . N is number of GT - boxes while M is the number of anchors in detection .
def __call__(self, matrix):
        """
        matrix(tensor): A two dim tensor with shape of (N, M). N is number of GT-boxes,
            while M is the number of anchors in detection.
        """
        assert len(matrix.shape) == 2
        max_scores = matrix.max(axis=0)
        match_indices = F.argmax(matrix, axis=0)

        # default ignore label: -1
        labels = F.full_like(match_indices, -1)

        for label, low, high in zip(self.labels, self.thresholds[:-1], self.thresholds[1:]):
            mask = (max_scores >= low) & (max_scores < high)
            labels[mask] = label

        if self.allow_low_quality_matches:
            mask = (matrix == F.max(matrix, axis=1, keepdims=True)).sum(axis=0) > 0
            labels[mask] = 1

        return match_indices, labels
def __call__ ( self , matrix ) : assert len ( matrix . shape ) == 2 max_scores = matrix . max ( axis = 0 ) match_indices = F . argmax ( matrix , axis = 0 ) # default ignore label: -1 labels = F . full_like ( match_indices , - 1 ) for label , low , high in zip ( self . labels , self . thresholds [ : - 1 ] , self . thresholds [ 1 : ] ) : mask = ( max_scores >= low ) & ( max_scores < high ) labels [ mask ] = label if self . allow_low_quality_matches : mask = ( matrix == F . max ( matrix , axis = 1 , keepdims = True ) ) . sum ( axis = 0 ) > 0 labels [ mask ] = 1 return match_indices , labels