Skip to content

Commit c83211c

Browse files
satraclaude
andcommitted
Apply ruff format to yamnet.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3b4b543 commit c83211c

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

  • src/senselab/audio/tasks/classification

src/senselab/audio/tasks/classification/yamnet.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)