Preprocessing and loading

From lza6/Armor-piercing-system-prompts · View interactive version

Preprocessing and loading is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Apply Nitrain transforms, random augmentation, samplers, and loader batching workflows.

How to use this skill

Skill file

Preprocessing and loading

Use this sub-skill when a user needs to transform images, apply random

augmentation, sample slices or patches, or batch a dataset with Loader or

Loader.to_keras().

What belongs here

label workflows.

SlicePatchSampler.

that sits between a Dataset and a model.

What does not belong here

sub-skills/datasets-readers/.

sub-skills/models-training/.

sub-skills/prediction-and-explanation/.

Typical user requests

Working pattern

  1. Decide whether the task is deterministic preprocessing, random augmentation,

or sampling.

  1. Route paired transforms with tuple keys such as ('inputs', 'outputs') when

the same operation must stay aligned.

  1. Use Loader after the dataset is already shaped the way the model expects.
  2. Pick the sampler based on the data geometry: slices for 3D-to-2D, patches

for 2D crops, blocks for 3D crops, and slice-patch for slice-wise patching.

Read these references

transform and sampler constructors.

preprocessing and batching examples.

mismatches, transform key errors, and loader warnings.

Smoke check

After installing dependencies, run the bundled helper scripts/check_install.py:

python scripts/check_install.py --mode preprocess

Use this when you want to confirm the transformation, sampler, and loader stack

before model construction or prediction.

Decision notes

disables the extra expansion.

the sampler emits batches.

are applied in order.

so paired inputs and outputs stay aligned.

Key categories

Deterministic image transforms

QuantileClip, Threshold

Translate

Random transforms

Samplers

Common outcomes

consume.

Watch for these signals

not match the dataset keys.

down to the dataset size.

support the requested geometry.

Before handing off

If the user actually needs architecture discovery, trainers, or prediction,

hand off to the relevant sibling sub-skill instead of adding that logic here.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.