diff options
| -rw-r--r-- | doc/CNN_EFFECT.md | 8 | ||||
| -rw-r--r-- | doc/HOWTO.md | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/CNN_EFFECT.md b/doc/CNN_EFFECT.md index d51c187..4659fd3 100644 --- a/doc/CNN_EFFECT.md +++ b/doc/CNN_EFFECT.md @@ -151,6 +151,14 @@ python3 training/train_cnn.py \ --output workspaces/main/shaders/cnn/cnn_weights_generated.wgsl ``` +**Generate ground truth (for shader validation):** +```bash +python3 training/train_cnn.py \ + --infer training/input/img_000.png \ + --export-only training/checkpoints/checkpoint_epoch_200.pth \ + --output training/ground_truth.png +``` + ### 3. Rebuild Demo Training script auto-generates both `cnn_weights_generated.wgsl` and `cnn_layer.wgsl`: diff --git a/doc/HOWTO.md b/doc/HOWTO.md index a57a161..5ea6afd 100644 --- a/doc/HOWTO.md +++ b/doc/HOWTO.md @@ -97,6 +97,11 @@ Generate shaders from checkpoint: ./training/train_cnn.py --export-only training/checkpoints/checkpoint_epoch_7000.pth ``` +Generate ground truth (for shader validation): +```bash +./training/train_cnn.py --infer input.png --export-only checkpoints/checkpoint_epoch_7000.pth --output ground_truth.png +``` + **Note:** Kernel sizes must match shader functions: - 3×3 kernel → `cnn_conv3x3_7to4` (36 weights: 9 pos × 4 channels) - 5×5 kernel → `cnn_conv5x5_7to4` (100 weights: 25 pos × 4 channels) |
