Skip to content
Back to skills

Data And Training

ASecurity

"Route U-2-Net dataset validation, transform inspection, and safe

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
code-qualitydebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-and-training --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data And Training?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data And Training
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-and-training-1e8ebdbd/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-and-training-1e8ebdbd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-and-training
description: "Route U-2-Net dataset validation, transform inspection, and safe
  retraining preparation without starting long training by default."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Data and Training

Use this sub-skill when the task is about U-2-Net training data layout, preprocessing transforms, batch/sample fields, the multi-side BCE training loop, or preparing a safe retraining run.

## Start here

1. Confirm the user has a DUTS-style training root or a deliberately adapted equivalent.
2. Validate image/mask stem pairing with [`scripts/validate_training_layout.py`](scripts/validate_training_layout.py) before discussing a training launch.
3. Inspect one representative image and optional label with [`scripts/inspect_data_pipeline.py`](scripts/inspect_data_pipeline.py) to confirm RescaleT/ToTensorLab-like output shapes and ranges.
4. Use [training workflow](references/training-workflow.md) for the exact source training settings and safe adaptation checklist.

Do **not** start the full training loop by default. The source loop is configured for `epoch_num=100000` and data-dependent long execution; require explicit user approval and a bounded run plan first.

## Core facts

- The training dataset is expected under `train_data/DUTS/DUTS-TR/DUTS-TR/im_aug/*.jpg` with matching masks under `train_data/DUTS/DUTS-TR/DUTS-TR/gt_aug/*.png` by the same filename stem.
- `SalObjDataset` yields sample dictionaries with `imidx`, `image`, and `label` keys; training composes `RescaleT(320)`, `RandomCrop(288)`, and `ToTensorLab(flag=0)`.
- The source training loop defaults to `model_name='u2net'`, `batch_size_train=12`, Adam learning rate `0.001`, checkpoint save frequency `2000` iterations, and summed BCE losses across seven side outputs.
- `model_name` can be changed to `u2netp`; keep checkpoint paths and model constructor consistent with that choice.

## References

- [Data formats](references/data-formats.md): dataset layout, sample dict schema, and transform behavior.
- [Training workflow](references/training-workflow.md): training hyperparameters, loss setup, checkpoint behavior, and safe retraining preparation.
- [API reference](references/api-reference.md): distilled dataset/transform APIs and bundled script CLI contracts.
- [Troubleshooting](references/troubleshooting.md): missing data, mismatched stems, crop size, mask shape, memory, and checkpoint failures.

## Routing boundaries

- Route salient-object or human segmentation inference to `salient-object-inference`.
- Route portrait inference, face crops, and portrait compositing to `portrait-workflows`.
- Route U2NET/U2NETP architecture internals and checkpoint shape debugging to `model-architecture`.
- Keep PaddleHub/Gradio demos out of this sub-skill unless the user is explicitly asking about optional demos rather than retraining.

Files in this skill

  • SKILL.md2.8 KB
  • references/api-reference.md2.3 KB
  • references/data-formats.md2.4 KB
  • references/training-workflow.md2.3 KB
  • references/troubleshooting.md2.1 KB
  • scripts/inspect_data_pipeline.py5.6 KB
  • scripts/validate_training_layout.py4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.