Skip to content

Commit

Permalink
replace pool.map with pool.imap_unordered (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatV authored Mar 1, 2024
1 parent 1e697c7 commit 6bc4e27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/labelme2yolo/l2y.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def convert(self, val_size, test_size):
with Pool(os.cpu_count() - 1) as pool, Progress() as progress:
task = progress.add_task("[cyan]Converting...", total=len(json_names))
func = partial(self.covert_json_to_text, target_dir)
for _ in pool.map(func, json_names):
for _ in pool.imap_unordered(func, json_names):
progress.update(task, advance=1)

self._save_dataset_yaml()
Expand Down

0 comments on commit 6bc4e27

Please sign in to comment.