AGENT SKILL

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

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, and iaa.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 imgcorruptlike when installed.
  • Deterministic pipeline reuse with to_deterministic().
  • Basic image input/output conventions: NHWC arrays, RGB order, uint8 expectations, and shape preservation when keep_size=True.
  • Safe visualization and contact-sheet generation via bundled helpers.

What it does not cover

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

  1. Read references/pipeline-workflows.md for the minimal image-pipeline recipes.
  2. Read references/augmenter-family-reference.md for family selection and parameter defaults.
  3. Run scripts/generate_augmentation_contact_sheet.py when you need a safe contact sheet or a tiny visual smoke.
  4. Read references/troubleshooting.md if 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 Sequential for ordered pipelines.
  • Use SomeOf when a bounded subset of augmenters should run.
  • Use OneOf when exactly one branch should run.
  • Use Sometimes for probability-gated branches.
  • Use WithChannels when only selected channels should change.
  • Use fit_output=False and keep_size=True as 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:

  1. The output image array keeps the expected shape and dtype.
  2. The pipeline actually changes pixels when it should.
  3. 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351