Skip to content

A python module for generating audio classifiers using Sklearn and Librosa

License

Notifications You must be signed in to change notification settings

pabletos/Audio-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Audio-classifier

A python module for generating audio classifiers using Sklearn and Librosa. It can be used to predict various audio labels given its features extracted using STFT embeddings.

Requirements

  • Python 3.X (Only tested in 3.6)
  • Librosa
  • Scikit-sklearn
  • Matplotlib (For tests)

Install

To install this package, simply type:

pip install librosa -U
pip install scikit-learn -U
git clone https://github.com/pabletos/Audio-classifier.git

How to use

There's no available documentation already (Coming SOON™) but you can use test_1 definition in test.pyto generate any classifier or use this as a basic template:

from classifier import extractor as ex
from classifier import trainer as tr
from classifier.utils import *

# Data folder must contain one folder per label, named as the label, containing their audios
DATA_PATH = "your//absolute//path//to//data//folder"

if __name__ == "__main__":
	dataset = ex.generate_dataset(DATA_PATH)
	plain_dataset = [(X, y) for y in dataset for X in dataset[y]]
	X, y = zip(*plain_dataset)

	# This creates the classifier as well as dumping it with pickle
	clf = tr.create_classifier(classifier, X, y)

License

This project is under MIT license, you can review it at the LICENSE included file in this repo.

Authors

About

A python module for generating audio classifiers using Sklearn and Librosa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages