Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. labels=os.listdir(train_audio_path)
  2.  
  3. #find count of each label and plot bar graph
  4. no_of_recordings=[]
  5. for label in labels:
  6. waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
  7. no_of_recordings.append(len(waves))
  8.  
  9. #plot
  10. plt.figure(figsize=(30,5))
  11. index = np.arange(len(labels))
  12. plt.bar(index, no_of_recordings)
  13. plt.xlabel('Commands', fontsize=12)
  14. plt.ylabel('No of recordings', fontsize=12)
  15. plt.xticks(index, labels, fontsize=15, rotation=60)
  16. plt.title('No. of recordings for each command')
  17. plt.show()
  18.  
  19. labels=["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement