multi_channel_experiment.py 文件源码

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

项目:bof-aed 作者: rgrzeszi 项目源码 文件源码
def calc_log_prob_for_files(self, annotations):
        '''
        Calculate the logprobs for the classification windows given in annotations
        @param annotations: Annotations as read from annotation file
        @return: tuple (features, labels). features is a list of logprobs-matrices for the windows.
                        labels is numpy-array of the labels for the respective windows.
        '''

        features = []
        labels = []

        annotation_dict = defaultdict(list)
        for anno in annotations:
            annotation_dict[anno[3]].append(anno)

        for filename, annos in annotation_dict.items():
            path = self.basepath + '/audio/' + filename
            self._calc_log_probs_for_windows(path, annos, features, labels)

        return features, np.array(labels)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号