diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-25 08:27:39 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-25 08:27:39 +0100 |
| commit | 3e4fece8fce11b368b4c7bab284242bf18e6a0b1 (patch) | |
| tree | 108682f727f7668e1df346563f4576d7e567dcd2 /cnn_v3/docs/HOWTO.md | |
| parent | 64095c683f15e8bd7c19d32041fcc81b1bd6c214 (diff) | |
feat(cnn_v3/training): add --single-sample option + doc fixes
- train_cnn_v3.py: --single-sample <dir> implies --full-image + --batch-size 1
- cnn_v3_utils.py: CNNv3Dataset accepts single_sample= kwarg (explicit override)
- HOWTO.md: document --single-sample workflow, fix pack_photo_sample.py usage (--target required)
- HOW_TO_CNN.md: fix GBufferEffect seq input (prev_cnn→source), fix binary name (demo→demo64k), add --resume to flag table, remove stale "pack without target" block
handoff(Gemini): --single-sample <dir> added to train_cnn_v3.py; docs audited and corrected
Diffstat (limited to 'cnn_v3/docs/HOWTO.md')
| -rw-r--r-- | cnn_v3/docs/HOWTO.md | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/cnn_v3/docs/HOWTO.md b/cnn_v3/docs/HOWTO.md index 58f09ed..1aead68 100644 --- a/cnn_v3/docs/HOWTO.md +++ b/cnn_v3/docs/HOWTO.md @@ -233,12 +233,13 @@ channel-dropout training. ```bash python3 cnn_v3/training/pack_photo_sample.py \ - --photo cnn_v3/training/input/photo1.jpg \ + --photo input/photo1.jpg \ + --target target/photo1_styled.png \ --output dataset/photos/sample_001/ ``` -The output `target.png` defaults to the input photo (no style). Copy in -your stylized version as `target.png` before training. +`--target` is required and must be a stylized ground-truth image at the same +resolution as the photo. The script writes it as `target.png` in the sample dir. ### Dataset layout @@ -285,10 +286,31 @@ python3 train_cnn_v3.py \ --patch-size 32 --detector random ``` +### Single-sample training + +Use `--single-sample <dir>` to train on one specific sample directory. +Implies `--full-image` and `--batch-size 1` automatically. + +```bash +# Pack input/target pair into a sample directory first +python3 pack_photo_sample.py \ + --photo input/photo1.png \ + --target target/photo1_styled.png \ + --output dataset/simple/sample_001/ + +# Train on that sample only +python3 train_cnn_v3.py \ + --single-sample dataset/simple/sample_001/ \ + --epochs 500 +``` + +All other flags (`--epochs`, `--lr`, `--checkpoint-dir`, `--enc-channels`, etc.) work normally. + ### Key flags | Flag | Default | Notes | |------|---------|-------| +| `--single-sample DIR` | — | Train on one sample dir; implies `--full-image`, `--batch-size 1` | | `--input DIR` | `training/dataset` | Root with `full/` or `simple/` subdirs | | `--input-mode` | `simple` | `simple`=photos, `full`=Blender G-buffer | | `--patch-size N` | `64` | Patch crop size | |
