def read_test_files(self, annotation_file):
'''
Read files for testing
'''
features_test = []
labels_test = []
annotation_file = self.basepath + '/annotations/general/' + annotation_file
annotations = self._read_annotations(annotation_file)
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
features, labels = self._read_test_windows(path, annos)
features_test.extend(features)
labels_test.extend(labels)
return features_test, labels_test
评论列表
文章目录