image-translation
Use Keras-GAN CycleGAN, DiscoGAN, and Pix2Pix image-to-image translation workflows safely: model APIs, dataset layout checks, adaptation guidance, and troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- image-translation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Keras-GAN CycleGAN, DiscoGAN, and Pix2Pix image-to-image translation workflows safely: model APIs, dataset layout checks, adaptation guidance, and troubleshooting.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/data-formats.md6.0 KB
- 参考文档references/model-api-reference.md7.7 KB
- 参考文档references/troubleshooting.md5.7 KB
- 参考文档references/workflows.md5.9 KB
- 脚本scripts/check_dataset_layout.py10.7 KB
03 SKILL.md 正文
Image Translation: CycleGAN, DiscoGAN, Pix2Pix
Use this sub-skill when a task involves Keras-GAN image-to-image translation with CycleGAN, DiscoGAN, or Pix2Pix. Treat the upstream project as a stale collection of standalone educational scripts, not an importable package or maintained training framework.
Route here for
- Unpaired two-domain translation such as
apple2orange,summer2winter_yosemite,horse2zebra, or otherA/Bdomain folders. - Paired side-by-side conditional translation such as
facadesoredges2shoes. - Inspecting or adapting the class APIs
CycleGAN,DiscoGAN, andPix2Pix, theirDataLoaderhelpers, PatchGAN output shapes, sample-image behavior, or stale Keras/TensorFlow runtime assumptions. - Safe dataset-layout validation before any constructor smoke test or training attempt.
Route elsewhere
- MNIST or latent-vector generators such as GAN, DCGAN, CGAN, AC-GAN, InfoGAN, BiGAN, CoGAN, LSGAN, WGAN, or WGAN-GP.
- Specialized restoration/domain-adaptation workflows such as Context Encoder, SRGAN, or PixelDA.
- Network dataset acquisition or long training jobs unless the user explicitly authorizes them; the original download scripts are reference-only.
Start with these bundled resources
-
Choose the workflow and API surface in references/model-api-reference.md.
-
Validate local data with the safe helper before running any model code:
python sub-skills/image-translation/scripts/check_dataset_layout.py \ --dataset-root datasets/apple2orange \ --workflow cyclegan \ --min-files 1 \ --check-imagesReplace
datasets/apple2orangewith the dataset directory visible to the caller. The helper performs no network access, imports no Keras models, and does not train. -
Use references/data-formats.md for expected folder layouts, split names, side-by-side image conventions, and preprocessing assumptions.
-
Use references/workflows.md for bounded adaptation, constructor-smoke, dataset-name, image-resolution, and sample-output workflows.
-
Use references/troubleshooting.md when imports, SciPy image utilities, empty batches, PatchGAN labels, or paired/unpaired data conventions fail.
Safety defaults
- Do not run the original network download scripts automatically.
- Do not run full training as a verification step; prefer dataset checks and constructor/import smoke checks in a pinned legacy environment.
- Keep generated outputs in caller-controlled directories such as
images/<dataset_name>/<epoch>_<batch>.png; note that the educational scripts createsaved_model/directories in the checkout but do not save weights by default. - If adapting code, preserve the
disc_patch = (img_rows / 2**4, img_rows / 2**4, 1)pattern and update it whenever image resolution changes.
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).