| Age | Commit message (Collapse) | Author |
|
- pack_photo_sample.py: --target now required (no albedo fallback)
- gen_sample.py: bash wrapper with positional args (input target output_dir)
- input/photo7.jpg: copy of photo2 (second style target)
- target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out
- dataset/simple/sample_001..007: 7 packed photo/target pairs
handoff(Gemini): training data ready; next step is train_cnn_v3.py run
|
|
- pack_photo_sample.py: --target now required (no albedo fallback)
- gen_sample: bash wrapper with positional args (input target output_dir)
- input/photo7.jpg: copy of photo2 (second style target)
- target_1: photo2_1_out→photo2_out, photo2_2_out→photo7_out
- dataset/simple/sample_001..007: 7 packed photo/target pairs
handoff(Gemini): training data ready; next step is train_cnn_v3.py run
|
|
C++:
- cnn_v3_effect.cc: fix declare_nodes comment (output node declared by caller)
- cnn_v3_effect.cc: add TODO(phase-7) marker for FiLM MLP replacement
WGSL:
- cnn_v3_bottleneck.wgsl: consolidate _pad fields onto one line, explain why
array<u32,3> is invalid in uniform address space
- cnn_v3_enc0.wgsl: fix "12xu8" → "12ch u8norm" in header comment
- cnn_v3_dec0.wgsl: clarify parity note (sigmoid after FiLM+ReLU, not raw conv)
- cnn_v3_common.wgsl: clarify unpack_8ch pack layout (low/high 16 bits)
Python:
- cnn_v3_utils.py: replace PIL-based _upsample_nearest (uint8 round-trip) with
pure numpy index arithmetic; rename _resize_rgb → _resize_img (handles any
channel count); add comment on normal zero-pad workaround
- export_cnn_v3_weights.py: add cross-ref to cnn_v3_effect.cc constants;
clarify weight count comments with Conv notation
Test:
- test_cnn_v3_parity.cc: enc0/dec1 layer failures now return 0 (were print-only)
handoff(Gemini): CNN v3 review complete, 36/36 tests passing.
|
|
3-file tool, 939 lines total. Implements full U-Net+FiLM inference in
the browser: Pack→Enc0→Enc1→Bottleneck→Dec1→Dec0 compute passes,
layer visualisation (Feat/Enc0/Enc1/BN/Dec1/Output), FiLM MLP sliders,
drag-drop weights + image/video, Save PNG, diff/blend view modes.
HOW_TO_CNN.md §7 updated to reflect tool is implemented.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- export_cnn_v3_weights.py: .pth → cnn_v3_weights.bin (f16 packed u32) + cnn_v3_film_mlp.bin (f32)
- HOW_TO_CNN.md: full pipeline playbook (data collection, training, export, C++ wiring, parity, HTML tool)
- TODO.md: mark export script done
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- train_cnn_v3.py: CNNv3 U-Net+FiLM model, training loop, CLI
- cnn_v3_utils.py: image I/O, pyrdown, depth_gradient, assemble_features,
apply_channel_dropout, detect_salient_points, CNNv3Dataset
- Patch-based training (default 64×64) with salient-point extraction
(harris/shi-tomasi/fast/gradient/random detectors, pre-cached at init)
- Channel dropout for geometric/context/temporal channels
- Random FiLM conditioning per sample for joint MLP+U-Net training
- docs: HOWTO.md §3 updated with commands and flag reference
- TODO.md: Phase 6 marked done, export script noted as next step
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- CNN_V3.md: status line, architecture channel counts (8/16→4/8), FiLM MLP
output count (96→40 params), size budget table (real implemented values)
- HOWTO.md: Phase status table (5→done, add phase 6 training TODO), sections
3-5 rewritten to reflect what exists vs what is still planned
|
|
- Add test_cnn_v3_parity.cc: zero_weights + random_weights tests
- Add gen_test_vectors.py: PyTorch reference implementation for enc0/enc1/bn/dec1/dec0
- Add test_vectors.h: generated C header with enc0, dec1, output expected values
- Fix declare_nodes(): intermediate textures at fractional resolutions (W/2, W/4)
using new NodeRegistry::default_width()/default_height() getters
- Add layer-by-layer readback (enc0, dec1) for regression coverage
- Final parity: enc0 max_err=1.95e-3, dec1 max_err=1.95e-3, out max_err=4.88e-4
handoff(Claude): CNN v3 parity done. Next: train_cnn_v3.py (FiLM MLP training).
|
|
- cnn_v3/src/cnn_v3_effect.{h,cc}: full Effect subclass with 5 compute
passes (enc0→enc1→bottleneck→dec1→dec0), shared weights storage buffer,
per-pass uniform buffers, set_film_params() API
- Fixed WGSL/C++ struct alignment: vec3u has align=16, so CnnV3Params4ch
is 64 bytes and CnnV3ParamsEnc1 is 96 bytes (not 48/80)
- Weight offsets computed as explicit formulas (e.g. 20*4*9+4) for clarity
- Registered in CMake, shaders.h/cc, demo_effects.h, test_demo_effects.cc
- 35/35 tests pass
handoff(Gemini): CNN v3 Phase 5 next — parity validation (Python ref vs WGSL)
|
|
5 compute shaders + cnn_v3/common snippet:
enc0: Conv(20→4,3×3) + FiLM + ReLU full-res
enc1: AvgPool + Conv(4→8,3×3) + FiLM + ReLU half-res
bottleneck: AvgPool + Conv(8→8,1×1) + ReLU quarter-res
dec1: NearestUp + cat(enc1) + Conv(16→4) + FiLM half-res
dec0: NearestUp + cat(enc0) + Conv(8→4) + FiLM + Sigmoid full-res
Parity rules: zero-pad conv, AvgPool down, NearestUp, FiLM after
conv+bias, skip=concat, OIHW weights+bias layout. Matches PyTorch
train_cnn_v3.py forward() exactly.
Registered in workspaces/main/assets.txt + src/effects/shaders.cc.
Weight layout + Params struct documented in cnn_v3/docs/HOWTO.md §7.
Next: Phase 4 — C++ CNNv3Effect + FiLM uniform upload.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Wire GBufferEffect into demo build: assets.txt, DemoSourceLists.cmake,
demo_effects.h, shaders.h/cc. ShaderComposer::Compose() applied to
gbuf_raster.wgsl (resolves #include "common_uniforms").
- Add GBufferEffect construction test. 35/35 passing.
- Write cnn_v3/docs/HOWTO.md: G-buffer wiring, training data prep,
training plan, per-pixel validation workflow, phase status table,
troubleshooting guide.
- Add project hooks: remind to update HOWTO.md on cnn_v3/ edits;
warn on direct str_view(*_wgsl) usage bypassing ShaderComposer.
- Update PROJECT_CONTEXT.md and TODO.md: Phase 1 done,
Phase 3 (WGSL U-Net shaders) is next active.
handoff(Gemini): CNN v3 Phase 3 is next - WGSL enc/dec/bottleneck/FiLM
shaders in cnn_v3/shaders/. See cnn_v3/docs/CNN_V3.md Architecture
section and cnn_v3/docs/HOWTO.md section 3 for spec. GBufferEffect
outputs feat_tex0 + feat_tex1 (rgba32uint, 20ch, 32 bytes/pixel).
C++ CNNv3Effect (Phase 4) takes those as input nodes.
|
|
G-buffer (Phase 1):
- Add NodeTypes GBUF_ALBEDO/DEPTH32/R8/RGBA32UINT to NodeRegistry
- GBufferEffect: MRT raster pass (albedo+normal_mat+depth) + pack compute
- Shaders: gbuf_raster.wgsl (MRT), gbuf_pack.wgsl (feature packing, 32B/px)
- Shadow/SDF passes stubbed (placeholder textures), CMake integration deferred
Training infrastructure (Phase 2):
- blender_export.py: headless EXR export with all G-buffer render passes
- pack_blender_sample.py: EXR → per-channel PNGs (oct-normals, 1/z depth)
- pack_photo_sample.py: photo → zero-filled G-buffer sample layout
handoff(Gemini): G-buffer phases 3-5 remain (U-Net shaders, CNNv3Effect, parity)
|
|
- CNN_V3.md: complete design document
- U-Net enc_channels=[4,8], ~5 KB f16 weights
- FiLM conditioning (5D → γ/β per level, CPU-side MLP)
- 20-channel feature buffer, 32 bytes/pixel: two rgba32uint textures
- feat_tex0: albedo.rgb, normal.xy, depth, depth_grad.xy (f16)
- feat_tex1: mat_id, prev.rgb, mip1.rgb, mip2.rgb, shadow, transp (u8)
- 4-pass G-buffer: raster MRT + SDF compute + lighting + pack
- Per-pixel parity framework: PyTorch / HTML WebGPU / C++ WebGPU (≤1/255)
- Training pipelines: Blender full G-buffer + photo-only (channel dropout)
- train_cnn_v3_full.sh spec (modelled on v2 script)
- HTML tool adaptation plan from cnn_v2/tools/cnn_v2_test/index.html
- Binary format v3 header spec
- 8-phase ordered implementation checklist
- TODO.md: add CNN v3 U-Net+FiLM future task with phases
- cnn_v3/README.md: update status to design phase
handoff(Gemini): CNN v3 design complete. Phase 0 (stub G-buffer) unblocks
all other phases — one compute shader writing feat_tex0+feat_tex1 with
synthetic values from the current framebuffer. See cnn_v3/docs/CNN_V3.md
Implementation Checklist.
|
|
|
|
|
|
Initialize CNN v3 subdirectory with training pipeline layout:
- docs/, scripts/, shaders/, src/, tools/, weights/ for organization
- training/input/ with sample images
- training/target_1/, target_2/ for multi-style training
- README.md documenting structure
Training images tracked in repo for easy collaboration.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|