data-preparation
Prepare and validate KAIR-compatible image, video, LMDB, and meta-info datasets without mutating source data.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-preparation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Prepare and validate KAIR-compatible image, video, LMDB, and meta-info datasets without mutating source data.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/data-layouts.md10.8 KB
- 参考文档references/data-preparation-workflows.md11.2 KB
- 参考文档references/troubleshooting.md7.8 KB
- 脚本scripts/check_dataset_layout.py9.6 KB
- 脚本scripts/plan_lmdb_conversion.py9.6 KB
03 SKILL.md 正文
KAIR data preparation
Use this sub-skill when the task is to prepare, inspect, or explain KAIR dataset inputs before training or testing. It covers image folders, paired LQ/GT data, video clip folders, Vimeo90K sequence folders, meta-info files, subimage plans, and LMDB plans.
Do not use this sub-skill for model command ownership. Route image training to ../image-training/SKILL.md, image inference to ../image-testing/SKILL.md, and VRT/RVRT model commands to ../video-restoration/SKILL.md; return here only for dataset layout, meta-info, or conversion questions.
Safe operating rules
- Treat KAIR as a source-script checkout: dataset tools in KAIR can be hard-coded and can write, move, copy, or delete data.
- Prefer the bundled read-only checkers and planners in this sub-skill before any conversion or regrouping.
- Before recommending a writer, state the expected input tree, output tree, key convention, and whether the operation is destructive or expensive.
- Never tell the user to run a hard-coded preparation script blindly. If they still want to use one, require a reviewed copy of the data and confirmed paths.
- Testing datasets for VRT/RVRT normally use frame folders directly; LMDB is mainly for training datasets.
References
references/data-layouts.md— train/test folder conventions, video layouts, meta-info formats, LMDB structure, and thedataset_typemapping.references/data-preparation-workflows.md— safe plans for DIV2K subimages/LMDBs, REDS, DVD, GoPro, UDM10, DAVIS, Vimeo90K, Set8, and MATLAB-only steps.references/troubleshooting.md— empty datasets, LQ/GT mismatches, existing output exits, destructive scripts, missing meta-info, LMDB conflicts, libpng fallback, and multiprocessing memory issues.
Bundled read-only scripts
Run these from any machine with Python 3; they do not import KAIR and do not write data.
python sub-skills/data-preparation/scripts/check_dataset_layout.py --help
python sub-skills/data-preparation/scripts/check_dataset_layout.py image --root trainsets/trainH
python sub-skills/data-preparation/scripts/check_dataset_layout.py video --root testsets/REDS4/sharp_bicubic --paired-root testsets/REDS4/GT
python sub-skills/data-preparation/scripts/check_dataset_layout.py lmdb --root trainsets/REDS/train_sharp_with_val.lmdb
python sub-skills/data-preparation/scripts/plan_lmdb_conversion.py --dataset div2k
python sub-skills/data-preparation/scripts/plan_lmdb_conversion.py --dataset reds
Quick routing
- "Create a DIV2K LMDB" → use
references/data-preparation-workflows.md#div2k-subimages-and-lmdbs, thenscripts/plan_lmdb_conversion.py --dataset div2k. - "Check REDS layout for VRT" → use
references/data-layouts.md#video-folder-layoutsandscripts/check_dataset_layout.py videoon both LQ and GT roots. - "Why no dataset found?" → use
references/troubleshooting.md#empty-dataset-or-no-images-foundand check folder depth, extensions, andfolder_lq/folder_gtpairing. - "Prepare GoPro as video" → use
references/data-preparation-workflows.md#gopro-video-deblurring-layout; warn that the original regrouping script moves folders and deletes the originaltrain/testfolders. - "List KAIR dataset_type values" → use
references/data-layouts.md#dataset_type-mapping.
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).