base.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:pumpp 作者: bmcfee 项目源码 文件源码
def decode_events(self, encoded):
        '''Decode labeled events into (time, value) pairs

        Parameters
        ----------
        encoded : np.ndarray, shape=(n_frames, m)
            Frame-level annotation encodings as produced by ``encode_events``.

            Real-valued inputs are thresholded at 0.5.

        Returns
        -------
        [(time, value)] : iterable of tuples
            where `time` is the event time and `value` is an
            np.ndarray, shape=(m,) of the encoded value at that time
        '''
        if np.isrealobj(encoded):
            encoded = (encoded >= 0.5)
        times = frames_to_time(np.arange(encoded.shape[0]),
                               sr=self.sr,
                               hop_length=self.hop_length)

        return zip(times, encoded)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号