AGENT SKILL

data-preparation

Prepare zi2zi paired glyph images and pickle streams from source/target fonts, charsets, labels, and rendered JPG directories.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
data-preparation
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Prepare zi2zi paired glyph images and pickle streams from source/target fonts, charsets, labels, and rendered JPG directories.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

zi2zi data preparation

Use this sub-skill when the task is about creating or validating zi2zi input data before training or inference. It covers the font-to-image renderer, charset choices, label naming, JPG pair schema, train.obj/val.obj packaging, and safe inspection of generated object files.

Use this sub-skill when

  • The user has source and target font files and wants zi2zi training images.
  • The user needs to choose between CN, CN_T, JP, KR, or a custom charset.
  • The task mentions font2img.py, package.py, sample_dir, label, filter, shuffle, train.obj, val.obj, or pickled (label, bytes) records.
  • Generated data is empty, labels are wrong, glyphs are missing, or a .obj file cannot be read.

Route elsewhere

  • For training, fine-tuning, losses, label shuffling during training, or checkpoints, read training-and-model.
  • For checkpoint inference, interpolation, GIFs, or export, read inference-and-export.
  • For Python/TensorFlow/SciPy compatibility that affects multiple workflows, read the root compatibility reference.

What zi2zi expects

  • A rendered example is one JPG containing two square glyph canvases side by side: target style on the left, source style on the right.
  • The filename must start with the integer embedding/style label followed by an underscore, for example 0_0000.jpg.
  • package.py scans *.jpg files in one directory, parses labels from the filename prefix, and writes pickled (label, image_bytes) records into train.obj and val.obj.
  • train.py later expects those object files under experiment/data/ unless the user deliberately changes the experiment layout.

Standard workflow

  1. Pick a source font and one or more target fonts.
  2. Assign each target font a stable integer label. Avoid reusing a label for a different target style within the same training run.
  3. Choose a built-in charset (CN, CN_T, JP, KR) or create a one-line UTF-8 text file for a custom character set.
  4. Render paired JPGs with font2img.py semantics. Use --filter=1 when the target font may be missing glyphs, and --shuffle=1 when you want a random sample from the charset.
  5. Package the rendered JPG directory into train.obj and val.obj with package.py semantics.
  6. Inspect record counts and label distribution before training.

Read preprocessing-workflow.md for complete command templates, multi-font labeling, and validation steps. Read data-formats.md for exact image/object schemas and charset behavior. Read troubleshooting.md when fonts, charsets, filters, labels, or pickle streams fail.

Bundled helpers

Quick checks before training

  • The samples directory contains JPGs, not PNGs or nested directories.
  • Every filename has an integer prefix before _.
  • Label count equals or is less than --embedding_num planned for training.
  • train.obj and val.obj both exist, even if the validation split is small.
  • Inspecting a few records shows image bytes and expected labels.
  • If validation is empty because the sample count is tiny and split randomness placed all examples in training, either accept that for a smoke test or create a deterministic tiny fixture outside the original script.

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