Skip to content
Back to skills

Training

ASecurity

"Use GFPGAN training, FFHQ degradation datasets, BasicSR configs,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
toolspythonbashdebugging

Security analysis

A100/100

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

Scanned September 8, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Training?

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

Security grade badge for Training
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-training-0e8dca07/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-training-0e8dca07)

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: training
description: "Use GFPGAN training, FFHQ degradation datasets, BasicSR configs,
  landmark preprocessing, model internals, and checkpoint conversion workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# GFPGAN Training and Data Workflows

Use this sub-skill when a user asks to train, fine-tune, configure, or debug GFPGAN model/data workflows rather than simply restore an image.

## Use This For

- Preparing FFHQ-style disk or LMDB data for `FFHQDegradationDataset`.
- Explaining `options/train_gfpgan_v1.yml` and `options/train_gfpgan_v1_simple.yml`-style config sections.
- Running the BasicSR-backed training launcher and understanding why full training is GPU/multi-GPU and data/checkpoint heavy.
- Using `GFPGANModel`, `GFPGANv1`, `GFPGANv1Clean`, `GFPGANBilinear`, `FacialComponentDiscriminator`, ArcFace identity loss, and StyleGAN2 generator components.
- Parsing FFHQ landmarks for component crops.
- Converting bilinear/original checkpoints to clean checkpoints.
- Debugging LMDB suffix errors, missing component paths, missing pretrained checkpoints, CUDA/extension issues, and config mismatch errors.

## Route Elsewhere

- Restoring images/folders, choosing inference version defaults, output layout, and `GFPGANer.enhance`: use `../inference/`.
- Package-wide dependency import checks: start with `../../references/installation.md` and `../../scripts/check_env.py`.
- Replicate/Cog deployment details: treat as deployment-specific and outside this training sub-skill.

## Quick Start

Before full training, validate imports and a config/data shape without starting a long run:

```bash
python sub-skills/training/scripts/check_env.py --json
```

Generate a component-landmark file from FFHQ metadata when using `crop_components: true`:

```bash
python sub-skills/training/scripts/parse_ffhq_landmarks.py \
  --json-path ffhq-dataset-v2.json \
  --save-path FFHQ_eye_mouth_landmarks_512.pth \
  --scale 0.5 \
  --enlarge-ratio 1.4
```

Convert a bilinear/original GFPGAN checkpoint to a clean checkpoint when following the v1.2 fine-tuning path:

```bash
python sub-skills/training/scripts/convert_checkpoint_to_clean.py \
  --ori-path bilinear_or_original_checkpoint.pth \
  --save-path GFPGAN_clean_converted.pth \
  --narrow 1 \
  --channel-multiplier 2
```

## References

- `references/workflows.md`: training, fine-tuning, validation, landmark, and conversion workflows.
- `references/configuration.md`: YAML sections, network/loss/path/data settings, and config decision points.
- `references/data-layout.md`: disk/LMDB layout, landmark `.pth` schema, dataset outputs, and fixture checks.
- `references/model-architecture.md`: verified model/component signatures and behavior.
- `references/troubleshooting.md`: training-specific data, checkpoint, CUDA, OpenCV, and config failures.

## Bundled Scripts

- `scripts/check_env.py`: verifies training imports, key signatures, CUDA visibility, and optional dataset config readability.
- `scripts/parse_ffhq_landmarks.py`: parameterized FFHQ landmark parser adapted from the source script without hardcoded paths.
- `scripts/convert_checkpoint_to_clean.py`: parameterized checkpoint converter adapted from the source conversion script.

## Decision Notes

- Use the simple config when the user wants to avoid component landmarks; use the full config when component discriminators and identity loss are required.
- If `crop_components: true`, the training config must point to a compatible landmark `.pth` file.
- Treat full training as expensive. Prefer smoke tests and config validation unless the user explicitly wants a long GPU training run.

Files in this skill

  • SKILL.md3.6 KB
  • references/configuration.md4.2 KB
  • references/data-layout.md3.3 KB
  • references/model-architecture.md3.8 KB
  • references/troubleshooting.md3.5 KB
  • references/workflows.md3.7 KB
  • scripts/check_env.py4.2 KB
  • scripts/convert_checkpoint_to_clean.py7.7 KB
  • scripts/parse_ffhq_landmarks.py5.6 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.