Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- labels=os.listdir(train_audio_path)
- #find count of each label and plot bar graph
- no_of_recordings=[]
- for label in labels:
- waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
- no_of_recordings.append(len(waves))
- #plot
- plt.figure(figsize=(30,5))
- index = np.arange(len(labels))
- plt.bar(index, no_of_recordings)
- plt.xlabel('Commands', fontsize=12)
- plt.ylabel('No of recordings', fontsize=12)
- plt.xticks(index, labels, fontsize=15, rotation=60)
- plt.title('No. of recordings for each command')
- plt.show()
- labels=["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement