msaf/algorithms/foote/segmenter.py
def processFlat(self):
        """Main process.
        Returns
        -------
        est_idxs : np.array(N)
            Estimated indeces the segment boundaries in frames.
        est_labels : np.array(N-1)
            Estimated labels for the segments.
        """
        # Preprocess to obtain features
        F = self._preprocess()

        # Normalize
        F = msaf.utils.normalize(F, norm_type=self.config["bound_norm_feats"])

        # Make sure that the M_gaussian is even
        if self.config["M_gaussian"] % 2 == 1:
            self.config["M_gaussian"] += 1

        # Median filter
        F = median_filter(F, M=self.config["m_median"])
        #plt.imshow(F.T, interpolation="nearest", aspect="auto"); plt.show()

        # Self similarity matrix
        S = compute_ssm(F)

        # Compute gaussian kernel
        G = compute_gaussian_krnl(self.config["M_gaussian"])
        #plt.imshow(S, interpolation="nearest", aspect="auto"); plt.show()

        # Compute the novelty curve
        nc = compute_nc(S, G)

        # Find peaks in the novelty curve
        est_idxs = pick_peaks(nc, L=self.config["L_peaks"])

        # Add first and last frames
        est_idxs = np.concatenate(([0], est_idxs, [F.shape[0] - 1]))

        # Empty labels
        est_labels = np.ones(len(est_idxs) - 1) * -1

        # Post process estimations
        est_idxs, est_labels = self._postprocess(est_idxs, est_labels)

        return est_idxs, est_labels
def processFlat(self):
        """Main process.
        Returns
        -------
        est_idxs : np.array(N)
            Estimated indeces the segment boundaries in frames.
        est_labels : np.array(N-1)
            Estimated labels for the segments.
        """
        # Preprocess to obtain features
        F = self._preprocess()

        # Normalize
        F = msaf.utils.normalize(F, norm_type=self.config["bound_norm_feats"])

        # Make sure that the M_gaussian is even
        if self.config["M_gaussian"] % 2 == 1:
            self.config["M_gaussian"] += 1

        # Median filter
        F = median_filter(F, M=self.config["m_median"])
        #plt.imshow(F.T, interpolation="nearest", aspect="auto"); plt.show()

        # Self similarity matrix
        S = compute_ssm(F)

        # Compute gaussian kernel
        G = compute_gaussian_krnl(self.config["M_gaussian"])
        #plt.imshow(S, interpolation="nearest", aspect="auto"); plt.show()

        # Compute the novelty curve
        nc = compute_nc(S, G)

        # Find peaks in the novelty curve
        est_idxs = pick_peaks(nc, L=self.config["L_peaks"])

        # Add first and last frames
        est_idxs = np.concatenate(([0], est_idxs, [F.shape[0] - 1]))

        # Empty labels
        est_labels = np.ones(len(est_idxs) - 1) * -1

        # Post process estimations
        est_idxs, est_labels = self._postprocess(est_idxs, est_labels)

        return est_idxs, est_labels
def processFlat ( self ) : # Preprocess to obtain features F = self . _preprocess ( ) # Normalize F = msaf . utils . normalize ( F , norm_type = self . config [ "bound_norm_feats" ] ) # Make sure that the M_gaussian is even if self . config [ "M_gaussian" ] % 2 == 1 : self . config [ "M_gaussian" ] += 1 # Median filter F = median_filter ( F , M = self . config [ "m_median" ] ) #plt.imshow(F.T, interpolation="nearest", aspect="auto"); plt.show() # Self similarity matrix S = compute_ssm ( F ) # Compute gaussian kernel G = compute_gaussian_krnl ( self . config [ "M_gaussian" ] ) #plt.imshow(S, interpolation="nearest", aspect="auto"); plt.show() # Compute the novelty curve nc = compute_nc ( S , G ) # Find peaks in the novelty curve est_idxs = pick_peaks ( nc , L = self . config [ "L_peaks" ] ) # Add first and last frames est_idxs = np . concatenate ( ( [ 0 ] , est_idxs , [ F . shape [ 0 ] - 1 ] ) ) # Empty labels est_labels = np . ones ( len ( est_idxs ) - 1 ) * - 1 # Post process estimations est_idxs , est_labels = self . _postprocess ( est_idxs , est_labels ) return est_idxs , est_labels
Main process.
        Returns
        -------
        est_idxs : np.array(N)
            Estimated indeces the segment boundaries in frames.
        est_labels : np.array(N-1)
            Estimated labels for the segments.
Main process . Returns ------- est_idxs : np . array ( N ) Estimated indeces the segment boundaries in frames . est_labels : np . array ( N - 1 ) Estimated labels for the segments .