Shortcuts

mmengine.utils.track_parallel_progress

mmengine.utils.track_parallel_progress(func, tasks, nproc, initializer=None, initargs=None, bar_width=50, chunksize=1, skip_first=False, keep_order=True, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[源代码]

Track the progress of parallel task execution with a progress bar.

The built-in multiprocessing module is used for process pools and tasks are done with Pool.map() or Pool.imap_unordered().

参数:
  • func (callable) – The function to be applied to each task.

  • tasks (Sequence) – If tasks is a tuple, it must contain two elements, the first being the tasks to be completed and the other being the number of tasks. If it is not a tuple, it represents the tasks to be completed.

  • nproc (int) – Process (worker) number.

  • initializer (None or callable) – Refer to multiprocessing.Pool for details.

  • initargs (None or tuple) – Refer to multiprocessing.Pool for details.

  • chunksize (int) – Refer to multiprocessing.Pool for details.

  • bar_width (int) – Width of progress bar.

  • skip_first (bool) – Whether to skip the first sample for each worker when estimating fps, since the initialization step may takes longer.

  • keep_order (bool) – If True, Pool.imap() is used, otherwise Pool.imap_unordered() is used.

返回:

The task results.

返回类型:

list

Read the Docs v: latest
Versions
latest
stable
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.