计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
multicore-and-diagnostics【效率与协作】Use when running imgaug batches in background processes or threads, tuning Pool/queue behavior, or diagnosing slow and hanging augmentation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill for imgaug's CPU parallelism and diagnostic surfaces: augment_batches(..., background=True), Augmenter.pool(), imgaug.multicore.Pool, BatchLoader, BackgroundAugmenter, safe smoke checks, and performance/hang triage.
map_batches, imap_batches, chunksize, processes, seed, and maxtasksperchild.BatchLoader and BackgroundAugmenter queue/worker configuration.../augmentation-pipelines/SKILL.md.../augmentables-and-batches/SKILL.md.../parameters-random-and-utilities/SKILL.md.BackgroundAugmenter hang?”chunksize or queue size be?”references/multicore-workflows.md for API patterns and safe defaults.references/diagnostics-and-performance.md before tuning worker counts or queues.scripts/tiny_multicore_smoke.py before attempting a large workload.references/troubleshooting.md for hangs, pickling errors, platform issues, and queue exhaustion.Augmenter.augment_batches(batches, hooks=None, background=False)Augmenter.pool(processes=None, maxtasksperchild=None, seed=None)imgaug.multicore.Pool(augseq, processes=None, maxtasksperchild=None, seed=None)Pool.map_batches(batches, chunksize=None)Pool.imap_batches(batches, chunksize=1, output_buffer_size=None)BatchLoader(load_batch_func, queue_size=50, nb_workers=1, threaded=True)BackgroundAugmenter(batch_loader, augseq, queue_size=50, nb_workers='auto')BackgroundAugmenter.get_batch()from imgaug.augmentables.batches import UnnormalizedBatch
import imgaug.augmenters as iaa
seq = iaa.Sequential([iaa.Fliplr(0.5), iaa.GaussianBlur((0.0, 1.0))])
batches_aug = seq.augment_batches(batches, background=True)
for batch in batches_aug:
consume(batch)
For explicit process control:
with seq.pool(processes=-1, seed=1) as pool:
batches_aug = pool.imap_batches(batches, chunksize=1)
for batch in batches_aug:
consume(batch)
Negative processes reserves that many logical cores when possible; -1 means all but one. Start with a tiny batch list and scale only after the smoke passes.
processes, queue sizes, and batch sizes.chunksize, maxtasksperchild, or background queue depth.