From 3e20c33f3e69c111c8a64c9b3ff9b454fd3aea88 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 11 Sep 2024 19:07:05 +0100 Subject: [PATCH] Support new segments.json format (#56) --- amt/run.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amt/run.py b/amt/run.py index b0bf425..ed154d8 100644 --- a/amt/run.py +++ b/amt/run.py @@ -469,9 +469,16 @@ def transcribe( for audio_path in file_paths: abs_audio_path = os.path.abspath(audio_path) if segments_by_audio_file.get(abs_audio_path, None) is not None: + # "segments": [start_s, end_s, segment_avg_score] + _segments = [ + [_start, _end] + for _start, _end, _ in segments_by_audio_file[abs_audio_path][ + "segments" + ] + ] file_info = { "path": abs_audio_path, - "segments": segments_by_audio_file[abs_audio_path]["segments"], + "segments": _segments, } else: file_info = {"path": abs_audio_path}