diff scripts/load_features.py @ 46:3ed4c6af5a93 branch-tests

fixed indentation
author Maria Panteli <m.x.panteli@gmail.com>
date Fri, 15 Sep 2017 16:34:30 +0100
parents 06e5711f9f62
children
line wrap: on
line diff
--- a/scripts/load_features.py	Fri Sep 15 16:23:23 2017 +0100
+++ b/scripts/load_features.py	Fri Sep 15 16:34:30 2017 +0100
@@ -121,7 +121,7 @@
             if len(music_idx)==0:  # or len(music_idx)<min_n_frames:
                 # no music segments or music segment too short -> skip this file
                 continue
-            if 1:
+            try:
                 # allow feature extraction of longer segments (2*stop_sec)
                 # because some of it might be speech segments that are filtered out
                 stop_sec_feat = 2 * stop_sec  
@@ -132,7 +132,7 @@
                 #    pb = self.load_precomputed_pb_from_melodia(df['Melodia'].iloc[i], stop_sec=stop_sec)
                 #else:
                 #    pb = self.get_pb_from_melodia(df['Melodia'].iloc[i], stop_sec=stop_sec)
-            else:
+            except:
                 continue
             n_stop = np.int(np.ceil(stop_sec * self.framessr2))
             print n_stop, len(op), len(mfcc), len(ch), len(pb)
@@ -276,7 +276,7 @@
             root = root_SM
         else:
             root = root_BL
-        base = base.split('_')[-1].split('.csv')[0]+'_vamp_mtg-melodia_melodia_melody.csv'
+            base = base.split('_')[-1].split('.csv')[0]+'_vamp_mtg-melodia_melodia_melody.csv'
         bihist_file = os.path.join(root, base)
         if not os.path.exists(bihist_file):
             return pbihist