Mercurial > hg > chourdakisreiss2016
annotate experiment-reverb/code/segmentation3.py @ 0:246d5546657c
initial commit, needs cleanup
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2016 13:15:48 +0000 |
parents | |
children |
rev | line source |
---|---|
e@0 | 1 # -*- coding: utf-8 -*- |
e@0 | 2 """ |
e@0 | 3 Created on Mon Jun 8 16:17:12 2015 |
e@0 | 4 |
e@0 | 5 @author: Emmanouil Theofanis Chourdakis |
e@0 | 6 """ |
e@0 | 7 |
e@0 | 8 from sys import argv |
e@0 | 9 import msaf |
e@0 | 10 |
e@0 | 11 |
e@0 | 12 if __name__=="__main__": |
e@0 | 13 if len(argv) != 3: |
e@0 | 14 print("Incorrect number of arguments:") |
e@0 | 15 print("Usage: ") |
e@0 | 16 print("%s <input> <output_folder>") |
e@0 | 17 print("") |
e@0 | 18 print("Arguments:") |
e@0 | 19 print("<input>\tThe input filename. Can be .wav, .mp3, etc...") |
e@0 | 20 print("<output_folder>\tThe output where the segmented parts will reside") |
e@0 | 21 sys.exit(-1) |
e@0 | 22 else: |
e@0 | 23 print("[II] Loading libraries") |
e@0 | 24 |
e@0 | 25 import essentia |
e@0 | 26 from essentia import Pool |
e@0 | 27 from essentia.standard import * |
e@0 | 28 import yaml |
e@0 | 29 |
e@0 | 30 |
e@0 | 31 # reqyures matplotlib |
e@0 | 32 from pylab import * |
e@0 | 33 |
e@0 | 34 #requires numpy |
e@0 | 35 from numpy import * |
e@0 | 36 |
e@0 | 37 #requires scikit-learn |
e@0 | 38 from sklearn.metrics import pairwise_distances |
e@0 | 39 |
e@0 | 40 d = {} |
e@0 | 41 v = {} |
e@0 | 42 |
e@0 | 43 fname = argv[1] |
e@0 | 44 |
e@0 | 45 name = fname.split('.')[-2].split('/')[-1] |
e@0 | 46 |
e@0 | 47 outdir = argv[2] |
e@0 | 48 |
e@0 | 49 print "[II] Processing using foote (200)..." |
e@0 | 50 |
e@0 | 51 estimations = msaf.process(fname) |