comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:246d5546657c
1 # -*- coding: utf-8 -*-
2 """
3 Created on Mon Jun 8 16:17:12 2015
4
5 @author: Emmanouil Theofanis Chourdakis
6 """
7
8 from sys import argv
9 import msaf
10
11
12 if __name__=="__main__":
13 if len(argv) != 3:
14 print("Incorrect number of arguments:")
15 print("Usage: ")
16 print("%s <input> <output_folder>")
17 print("")
18 print("Arguments:")
19 print("<input>\tThe input filename. Can be .wav, .mp3, etc...")
20 print("<output_folder>\tThe output where the segmented parts will reside")
21 sys.exit(-1)
22 else:
23 print("[II] Loading libraries")
24
25 import essentia
26 from essentia import Pool
27 from essentia.standard import *
28 import yaml
29
30
31 # reqyures matplotlib
32 from pylab import *
33
34 #requires numpy
35 from numpy import *
36
37 #requires scikit-learn
38 from sklearn.metrics import pairwise_distances
39
40 d = {}
41 v = {}
42
43 fname = argv[1]
44
45 name = fname.split('.')[-2].split('/')[-1]
46
47 outdir = argv[2]
48
49 print "[II] Processing using foote (200)..."
50
51 estimations = msaf.process(fname)