augmentation-pipelines
Use when building, combining, or debugging imgaug image augmentation pipelines, augmenter families, or deterministic image-only transforms.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- augmentation-pipelines
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use when building, combining, or debugging imgaug image augmentation pipelines, augmenter families, or deterministic image-only transforms.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/augmenter-family-reference.md3.5 KB
- 参考文档references/pipeline-workflows.md2.4 KB
- 参考文档references/troubleshooting.md2.5 KB
- 脚本scripts/generate_augmentation_contact_sheet.py1.9 KB
03 SKILL.md 正文
Augmentation Pipelines
Use this sub-skill when the task is about image augmentation pipelines in imgaug: choosing augmenter families, composing them with Sequential/SomeOf/OneOf/Sometimes, applying transforms deterministically, or debugging image-only augmentation behavior.
What this sub-skill covers
- Pipeline composition with
iaa.Sequential,iaa.SomeOf,iaa.OneOf,iaa.Sometimes, andiaa.WithChannels. - Image-only use of common augmenter families: affine/geometric, crop/pad/resize, blur, arithmetic/noise, color, contrast, blend/overlay, segmentation/superpixels, weather, PIL-like effects, and
imgcorruptlikewhen installed. - Deterministic pipeline reuse with
to_deterministic(). - Basic image input/output conventions: NHWC arrays, RGB order,
uint8expectations, and shape preservation whenkeep_size=True. - Safe visualization and contact-sheet generation via bundled helpers.
What it does not cover
- Annotation object construction and batch normalization details belong to
../augmentables-and-batches/SKILL.md. - Random seed, stochastic parameter, dtype, and sample-data details belong to
../parameters-random-and-utilities/SKILL.md. - Background multiprocessing and
Poolbehavior belong to../multicore-and-diagnostics/SKILL.md.
Typical triggers
- “How do I build an imgaug pipeline with flips, affine, blur, and color jitter?”
- “Why did my augmentation change the image shape?”
- “How do I apply the same sampled transform twice?”
- “Which augmenter should I use for cropping, padding, weather, or superpixels?”
Fast path
- Read
references/pipeline-workflows.mdfor the minimal image-pipeline recipes. - Read
references/augmenter-family-reference.mdfor family selection and parameter defaults. - Run
scripts/generate_augmentation_contact_sheet.pywhen you need a safe contact sheet or a tiny visual smoke. - Read
references/troubleshooting.mdif the pipeline gives unexpected shapes, dtypes, or color results.
Core usage pattern
Image pipelines usually take numpy.ndarray input of shape (N, H, W, C) or a list of (H, W, C) arrays. Most examples assume RGB uint8 images.
import numpy as np
import imgaug.augmenters as iaa
images = np.zeros((4, 64, 64, 3), dtype=np.uint8)
seq = iaa.Sequential([
iaa.Fliplr(0.5),
iaa.Affine(rotate=(-10, 10), translate_px={"x": (-2, 2)}),
iaa.GaussianBlur(sigma=(0.0, 1.0)),
])
images_aug = seq(images=images)
Use to_deterministic() when you need the same sampled transform in separate calls. Prefer a single call containing all aligned data whenever the task also includes annotations.
Common pipeline decisions
- Use
Sequentialfor ordered pipelines. - Use
SomeOfwhen a bounded subset of augmenters should run. - Use
OneOfwhen exactly one branch should run. - Use
Sometimesfor probability-gated branches. - Use
WithChannelswhen only selected channels should change. - Use
fit_output=Falseandkeep_size=Trueas safe defaults until a task explicitly needs output resizing. - Keep
uint8/RGB in mind when the task starts from OpenCV or camera data.
Handy families and when to reach for them
Affine,PerspectiveTransform,ElasticTransformation,Jigsaw: geometric distortions.Crop,Pad,CropAndPad,Resize,KeepSizeByResize: size and framing.GaussianBlur,AverageBlur,MedianBlur,MotionBlur,BilateralBlur,MeanShiftBlur: smoothing/blur.Add,Multiply,Dropout,CoarseDropout,Invert,Solarize,JpegCompression: arithmetic/noise/compression.WithHueAndSaturation,ChangeColorspace,Grayscale,Posterize,KMeansColorQuantization,UniformColorQuantization: color and palette changes.LinearContrast,GammaContrast,HistogramEqualization,CLAHE: contrast shaping.BlendAlpha,SimplexNoiseAlpha,FrequencyNoiseAlpha: masked blending and partial effects.Superpixels,Voronoi,Snowflakes,Rain,Fog,Clouds,FastSnowyLandscape: segmentation-like and weather effects.
Validation mindset
A good image-pipeline smoke should prove three things:
- The output image array keeps the expected shape and dtype.
- The pipeline actually changes pixels when it should.
- A deterministic replay produces identical results.
Use the bundled script to check those properties with tiny arrays before moving to annotation-aware or multicore workflows.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).