【发布时间】:2022-12-12 06:36:43
【问题描述】:
我试图在从羽毛球比赛中获取的源音频文件中找到实例,其中一名球员击球。出于同样的目的,我用正面(命中声音)和负面(没有命中声音:评论/人群声音等)标签标记了时间戳,如下所示:
shot_timestamps = [0,6.5,8, 11, 18.5, 23, 27, 29, 32, 37, 43.5, 47.5, 52, 55.5, 63, 66, 68, 72, 75, 79, 94.5, 96, 99, 105, 122, 115, 118.5, 122, 126, 130.5, 134, 140, 144, 147, 154, 158, 164, 174.5, 183, 186, 190, 199, 238, 250, 253, 261, 267, 269, 270, 274]
shot_labels = ['no', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no','no','no', 'no', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'no', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'yes', 'no', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'no']
我一直在这些时间戳周围使用 1 秒窗口,如下所示:
rate, source = wavfile.read(source)
def get_audio_snippets(shot_timestamps):
shot_snippets = [] # Collection of all audio snippets in the timestamps above
for timestamp in shot_timestamps:
start = math.ceil(timestamp*rate)
end = math.ceil((timestamp + 1)*rate)
if start >= source.shape[0]:
start = source.shape[0] - 1
if end >= source.shape[0]:
end = source.shape[0] - 1
shot_snippets.append(source[start:end])
return shot_snippets
并将其转换为模型的频谱图图像。该模型似乎没有学到任何准确率在 50% 左右的东西。我可以做些什么来改进模型?
编辑:
音频文件:Google Drive
时间戳标签:Google Drive
代码:Github
这些时间戳是最近制作的,并没有在上面的代码中使用,因为我不完全知道用于标记目的的窗口大小。上面的注释文件包含击球的所有时间戳。
PS:还按照推荐在 Data Science Stackexchange 上添加了这个:https://datascience.stackexchange.com/q/116629/98765
【问题讨论】:
-
你是如何进行频谱图转换的?当您绘制是/否类别的频谱图(比如每个 10 个)时,数据看起来如何?
-
模型看起来如何,训练完成了吗?
-
你能提供与注释相匹配的音频文件吗?
-
@JonNordby 感谢您的宝贵时间。我已经用您在此处要求的大部分信息更新了问题。确切的代码可以在 Github 存储库中的 (3.1) 文件编号中找到。
标签: python machine-learning audio deep-learning librosa