Skip to content

Commit ec778ea

Browse files
authored
small progress bar fix (#779)
* small progress bar fix * fix wrong display of collected files in batch analysis
1 parent 7a44df1 commit ec778ea

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

birdnet_analyzer/embeddings/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,15 @@ def run(audio_input, database, overlap, audio_speed, fmin, fmax, threads, batchs
246246
# One less process for the pool, because we use one extra for the consumer
247247
with mp.Pool(processes=cfg.CPU_THREADS - 1) as pool:
248248
delta = chunksize
249+
processed_files = set()
249250
with tqdm(total=len(flist), desc="Files processed") as pbar:
250251
# Instead of chunk_size arg, manual splitting, because this reduces the overhead for the iterable.
251252
for res in pool.imap_unordered(analyze_file, [flist[i : i + delta] for i in range(0, len(flist), delta)], chunksize=1):
253+
num_already_processed = len(processed_files)
254+
processed_files.update([r[0] for r in res])
255+
delta = len(processed_files) - num_already_processed
252256
queue.put(res)
253-
pbar.update(len(res))
257+
pbar.update(delta)
254258

255259
queue.put([("STOP", 0, 0, None)])
256260
consumer_process.join()

birdnet_analyzer/gui/multi_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def select_directory_on_empty(): # Nishant - Function modified for For Folder s
122122
if folder:
123123
files_and_durations = gu.get_audio_files_and_durations(folder)
124124
if len(files_and_durations) > 100:
125-
return [folder, *files_and_durations[:100], ["..."]] # hopefully fixes issue#272
125+
return [folder, [*files_and_durations[:100], ("...", "...")]] # hopefully fixes issue#272
126126
return [folder, files_and_durations]
127127

128128
return ["", [[loc.localize("multi-tab-samples-dataframe-no-files-found")]]]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "birdnet_analyzer"
7-
version = "2.1.1"
7+
version = "2.2.0"
88
license = { text = "MIT" }
99
description = "BirdNET analyzer for scientific audio data processing and bird classification."
1010
authors = [{ name = "Stefan Kahl" }]

0 commit comments

Comments
 (0)