def af_h5_to_np(input_path, outpath):
files = tables.open_file(input_path, mode = 'r+')
speaker_nodes = files.root._f_list_nodes()
for spk in speaker_nodes:
file_nodes = spk._f_list_nodes()
for fls in file_nodes:
file_name = fls._v_name
af_nodes = fls._f_list_nodes()
af_list = []
for fts in af_nodes:
features = fts[:]
mean = numpy.mean(features,1)
normalised_feats = list(numpy.transpose(features)/mean)
af_list += normalised_feats
numpy.save(outpath + file_name, numpy.array(af_list))
af_h5_to_nparray.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录