summaryrefslogtreecommitdiff
path: root/cnn_v3
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3')
-rw-r--r--cnn_v3/docs/HOW_TO_CNN.md23
-rwxr-xr-xcnn_v3/training/gen_sample21
2 files changed, 23 insertions, 21 deletions
diff --git a/cnn_v3/docs/HOW_TO_CNN.md b/cnn_v3/docs/HOW_TO_CNN.md
index 69bbf6f..bb6f7a7 100644
--- a/cnn_v3/docs/HOW_TO_CNN.md
+++ b/cnn_v3/docs/HOW_TO_CNN.md
@@ -225,6 +225,29 @@ done
- Alpha convention: Blender alpha=1 means opaque; `transp.png` inverts this (transp=0 opaque)
- `Shadow` pass in Cycles must be explicitly enabled in Render Properties → Passes → Effects
+#### Full example (Old House scene, 2 frames)
+
+**Step 1 — Render:**
+```bash
+cd cnn_v3/training
+blender4 -b input_3d/"Old House 2 3D Models.blend" -P blender_export.py -- \
+ --output tmp/renders/frames \
+ --width 640 --height 360 \
+ --start-frame 1 --end-frame 2 \
+ --view-layer RenderLayer
+```
+
+**Step 2 — Pack:**
+```bash
+cd cnn_v3/training
+for exr in tmp/renders/frames/*.exr; do
+ name=$(basename "${exr%.exr}")
+ python3 pack_blender_sample.py \
+ --exr "$exr" \
+ --output dataset/full/sample_${name}/
+done
+```
+
---
### 1c. Dataset Layout
diff --git a/cnn_v3/training/gen_sample b/cnn_v3/training/gen_sample
deleted file mode 100755
index 21519f1..0000000
--- a/cnn_v3/training/gen_sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-# gen_sample — pack an input/target photo pair into a CNN v3 sample directory.
-#
-# Usage:
-# gen_sample <input> <target> <output_dir>
-#
-# Example:
-# gen_sample input/photo1.jpg target_1/photo1_out.png dataset/simple/sample_001
-
-set -euo pipefail
-
-if [ $# -ne 3 ]; then
- echo "Usage: gen_sample <input> <target> <output_dir>" >&2
- exit 1
-fi
-
-SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
-python3 "$SCRIPT_DIR/pack_photo_sample.py" \
- --photo "$1" \
- --target "$2" \
- --output "$3"