From: Thomas Fillon Date: Thu, 14 Aug 2014 10:52:20 +0000 (+0200) Subject: fix(analyzer): use new API for accessing analyzer results X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=453092a54e5d2937cb6af85f0a085645962d633e;p=timeside.git fix(analyzer): use new API for accessing analyzer results --- diff --git a/timeside/analyzer/irit_diverg.py b/timeside/analyzer/irit_diverg.py index aa9667a..4c4c29e 100644 --- a/timeside/analyzer/irit_diverg.py +++ b/timeside/analyzer/irit_diverg.py @@ -390,7 +390,7 @@ class IRITDiverg(Analyzer): return frames, eod def post_process(self): - audio_data = self.process_pipe.results['waveform_analyzer'].data + audio_data = self.process_pipe.results.get_result_by_id('waveform_analyzer').data if audio_data.shape[1] > 1: data = list(audio_data.mean(axis=1)) else: diff --git a/timeside/analyzer/irit_music_.py b/timeside/analyzer/irit_music_.py index 768de8e..1f709df 100644 --- a/timeside/analyzer/irit_music_.py +++ b/timeside/analyzer/irit_music_.py @@ -66,7 +66,7 @@ class IRITMusicLDN(Analyzer): ''' ''' - segList = self.process_pipe.results['irit_diverg.segments'].time + segList = self.process_pipe.resultsget_result_by_id('irit_diverg.segments').time w = self.wLen / 2 end = segList[-1] tLine = arange(0, end, self.wStep) diff --git a/timeside/analyzer/irit_music_SLN.py b/timeside/analyzer/irit_music_SLN.py index 28f5e29..989d76b 100644 --- a/timeside/analyzer/irit_music_SLN.py +++ b/timeside/analyzer/irit_music_SLN.py @@ -74,7 +74,7 @@ class IRITMusicSLN(Analyzer): ''' - segList = self.process_pipe.results['irit_diverg.segments'].time + segList = self.process_pipe.results.get_result_by_id('irit_diverg.segments').time w = self.wLen / 2 end = segList[-1] diff --git a/timeside/analyzer/irit_music_SNB.py b/timeside/analyzer/irit_music_SNB.py index db5ce04..a74dc0f 100644 --- a/timeside/analyzer/irit_music_SNB.py +++ b/timeside/analyzer/irit_music_SNB.py @@ -73,7 +73,7 @@ class IRITMusicSNB(Analyzer): ''' - segList = self.process_pipe.results['irit_diverg.segments'].time + segList = self.process_pipe.results.get_result_by_id('irit_diverg.segments').time w = self.wLen / 2 end = segList[-1] tLine = arange(0, end, self.wStep) diff --git a/timeside/analyzer/irit_singings.py b/timeside/analyzer/irit_singings.py index b95b5d6..18b1600 100644 --- a/timeside/analyzer/irit_singings.py +++ b/timeside/analyzer/irit_singings.py @@ -100,8 +100,8 @@ class IRITSingings(Analyzer): """ """ - preproc = self.process_pipe.results['irit_monopoly.segments'].data_object - labels = self.process_pipe.results['irit_monopoly.segments'].label_metadata['label'] + preproc = self.process_pipe.results.get_result_by_id('irit_monopoly.segments').data_object + labels = self.process_pipe.results.get_result_by_id('irit_monopoly.segments').label_metadata['label'] segments_monopoly = [(start, duration, labels[label])for start, duration, label in zip(preproc.time, preproc.duration, preproc.label)] diff --git a/timeside/analyzer/limsi_diarization.py b/timeside/analyzer/limsi_diarization.py index 93058db..fefdc0d 100644 --- a/timeside/analyzer/limsi_diarization.py +++ b/timeside/analyzer/limsi_diarization.py @@ -46,7 +46,7 @@ def gauss_div(data, winsize): meandiff = N.mean(w1, axis = 0) - N.mean(w2, axis = 0) invstdprod = 1. / (N.std(w1, axis = 0) * N.std(w2, axis = 0)) ret.append(N.sum(meandiff * meandiff * invstdprod)) - + return ret @@ -85,7 +85,7 @@ class LimsiDiarization(Analyzer): # feature extraction defition spec = yaafelib.FeaturePlan(sample_rate=16000) spec.addFeature('mfccchop: MFCC CepsIgnoreFirstCoeff=0 blockSize=1024 stepSize=256') - parent_analyzer = Yaafe(spec) + parent_analyzer = Yaafe(spec) self.parents.append(parent_analyzer) # informative parameters @@ -117,10 +117,10 @@ class LimsiDiarization(Analyzer): return frames, eod def post_process(self): - mfcc = self.process_pipe.results['yaafe.mfccchop']['data_object']['value'] + mfcc = self.process_pipe.results.get_result_by_id('yaafe.mfccchop')['data_object']['value'] sw = YaafeFrame(self.input_blocksize, self.input_stepsize, self.input_samplerate) - pyannotefeat = SlidingWindowFeature(mfcc, sw) + pyannotefeat = SlidingWindowFeature(mfcc, sw) # speech activity detection: usefull for debugging purpose only # print 'adding sad res to result' @@ -137,7 +137,7 @@ class LimsiDiarization(Analyzer): gdiff_win_size_frame = int(self.gdiff_win_size_sec / timestepsize) min_seg_size_frame = int(self.min_seg_size_sec / timestepsize) # print 'timestepsize %d, gdiffwinsize (sec: %f, frame: %d) , minsegsize (sec: %f, frame: %d)' % (timestepsize, self.gdiff_win_size_sec, gdiff_win_size_frame, self.min_seg_size_sec, min_seg_size_frame) - + # basic gauss div #bgd = (range(0, len(mfcc)), 'basicgdiv')