File tree Expand file tree Collapse file tree
src/senselab/audio/tasks/classification Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,10 +118,12 @@ def classify_with_yamnet(
118118 audio_paths .append (path )
119119 durations .append (resampled .waveform .shape [1 ] / resampled .sampling_rate )
120120
121- input_json = json .dumps ({
122- "audio_paths" : audio_paths ,
123- "top_k" : top_k ,
124- })
121+ input_json = json .dumps (
122+ {
123+ "audio_paths" : audio_paths ,
124+ "top_k" : top_k ,
125+ }
126+ )
125127
126128 env = _clean_subprocess_env ()
127129 result = subprocess .run (
@@ -143,14 +145,16 @@ def classify_with_yamnet(
143145 for i , w in enumerate (windows ):
144146 start = i * cls .HOP_SECONDS
145147 end = min (start + cls .WINDOW_SECONDS , duration )
146- timestamped .append ({
147- "start" : start ,
148- "end" : end ,
149- "labels" : w ["labels" ],
150- "scores" : w ["scores" ],
151- "win_length" : cls .WINDOW_SECONDS ,
152- "hop_length" : cls .HOP_SECONDS ,
153- })
148+ timestamped .append (
149+ {
150+ "start" : start ,
151+ "end" : end ,
152+ "labels" : w ["labels" ],
153+ "scores" : w ["scores" ],
154+ "win_length" : cls .WINDOW_SECONDS ,
155+ "hop_length" : cls .HOP_SECONDS ,
156+ }
157+ )
154158 all_results .append (timestamped )
155159
156160 return all_results
You can’t perform that action at this time.
0 commit comments