preprocessing-and-loading
БесплатноБез исполняемых скриптовНе проверенApply Nitrain transforms, random augmentation, samplers, and loader batching workflows.
от lza6★ 19 звёзд на GitHubОб этом скилле
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
- Deterministic transforms for image, intensity, math, shape, spatial, and label workflows.
- Random transforms that wrap those deterministic transforms.
BaseSampler,SliceSampler,PatchSampler,BlockSampler, andSlicePatchSampler.Loader,Loader.copy(),Loader.to_keras(), and the batch-shaping logic that sits between aDatasetand a model.
What does not belong here
- Building datasets from source files or cloud storage: use
sub-skills/datasets-readers/. - Model discovery, trainers, or pretrained weights: use
sub-skills/models-training/. - Prediction and explanation post-processing: use
sub-skills/prediction-and-explanation/.
Typical user requests
- "Normalize and resample the images before training"
- "Apply the same transform to inputs and outputs"
- "Sample 2D slices from 3D volumes"
- "Batch the dataset for Keras"
- "Why did my transform or sampler fail on this image shape?"
Working pattern
- Decide whether the task is deterministic preprocessing, random augmentation, or sampling.
- Route paired transforms with tuple keys such as
('inputs', 'outputs')when the same operation must stay aligned. - Use
Loaderafter the dataset is already shaped the way the model expects. - 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
- references/api-reference.md for the transform and sampler constructors.
- references/workflows.md for canonical preprocessing and batching examples.
- references/troubleshooting.md for shape 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
channels_first=Trueadds a channel axis in the loader;channels_first=Nonedisables the extra expansion.Loader.transformsapplies after the dataset records are collected and before the sampler emits batches.- A transform value may be a single transform or a list/tuple of transforms that are applied in order.
- A tuple transform key means the transform should see all named values together so paired inputs and outputs stay aligned.
Key categories
Deterministic image transforms
Astype,Smooth,Crop,Resample,Slice,PadImageMath,BiasCorrection,StandardNormalize,RangeNormalize,Clip,QuantileClip,ThresholdAbs,Ceil,Floor,Log,Exp,Sqrt,PowerAddChannel,ReorientApplyAntsTransform,AffineTransform,Shear,Rotate,Zoom,Flip,TranslateLabelsToChannelsCustomFunction,NumpyFunction
Random transforms
RandomCropRandomShear,RandomRotate,RandomZoom,RandomFlip,RandomTranslate
Samplers
BaseSamplerfor plain batchingSliceSamplerfor 2D slices from 3D volumesPatchSamplerfor 2D patchesBlockSamplerfor 3D blocksSlicePatchSamplerfor slice-then-patch workflows
Common outcomes
Loader.__iter__()returns numpy batches with the expected channel layout.Loader.to_keras()returns atf.data.Dataset-style object that Keras can consume.- Samplers keep batch length and crop geometry consistent with the chosen mode.
Watch for these signals
Some names in your transform were not foundmeans the transform key labels do not match the dataset keys.images_per_batchlarger than the dataset triggers a warning and is clipped down to the dataset size.- Slice, patch, and block samplers only work when the images are large enough to 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.
Установить preprocessing-and-loading в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл preprocessing-and-loading?
Apply Nitrain transforms, random augmentation, samplers, and loader batching workflows.
Как установить скилл preprocessing-and-loading?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл preprocessing-and-loading запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic