Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

#2985 Added Progress bars to transcribe.py #3808

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements_eval_tflite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ progressbar2==3.47.0
python-utils==2.3.0
six==1.13.0
pandas==0.25.3
tqdm
mutliprocessing
10 changes: 6 additions & 4 deletions transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import logging
logging.getLogger('sox').setLevel(logging.ERROR)
import glob
from tqdm import tqdm
from _multiprocessing import Process

from deepspeech_training.util.audio import AudioFile
from deepspeech_training.util.config import Config, initialize_globals
Expand Down Expand Up @@ -73,14 +75,14 @@ def transcribe_file(audio_path, tlog_path):


def transcribe_many(src_paths,dst_paths):
pbar = create_progressbar(prefix='Transcribing files | ', max_value=len(src_paths)).start()
pbar = tqdm(total=len(src_paths), desc='Transcribing files', unit='file')
for i in range(len(src_paths)):
p = Process(target=transcribe_file, args=(src_paths[i], dst_paths[i]))
p.start()
p.join()
log_progress('Transcribed file {} of {} from "{}" to "{}"'.format(i + 1, len(src_paths), src_paths[i], dst_paths[i]))
pbar.update(i)
pbar.finish()
log_progress(f'Transcribed file {i + 1} of {len(src_paths)} from "{src_paths[i]}" to "{dst_paths[i]}"')
pbar.update(1)
pbar.close()


def transcribe_one(src_path, dst_path):
Expand Down