diff options
Diffstat (limited to 'tools/cnn_v2_test/README.md')
| -rw-r--r-- | tools/cnn_v2_test/README.md | 94 |
1 files changed, 57 insertions, 37 deletions
diff --git a/tools/cnn_v2_test/README.md b/tools/cnn_v2_test/README.md index 2a8e08d..b9439e5 100644 --- a/tools/cnn_v2_test/README.md +++ b/tools/cnn_v2_test/README.md @@ -6,12 +6,14 @@ WebGPU-based browser tool for testing trained CNN v2 weights. ## Features -- Drag-drop PNG images and `.bin` weights +- Drag-drop PNG images and `.bin` weights (or click to browse) - Real-time CNN inference with WebGPU compute shaders - View modes: CNN output, original input, difference (×10) - Adjustable blend amount and depth - Data-driven pipeline (supports variable layer count) - GPU timing display +- **Left Panel:** Weights info + kernel visualization (1px/weight, all layers) +- **Right Panel:** Layer activation viewer with 4-channel split + 4× zoom --- @@ -41,28 +43,36 @@ python3 -m http.server 8000 ### 2. Load Data -1. **Drop PNG image** anywhere in window (shows preview immediately) -2. **Drop `.bin` weights** into header drop zone +1. **Drop `.bin` weights** into left sidebar zone (or click to browse) +2. **Drop PNG image** anywhere in center canvas area 3. CNN runs automatically when both loaded -### 3. Controls +### 3. Layout -**Sliders:** -- **Blend:** Mix between original (0.0) and CNN output (1.0) -- **Depth:** Uniform depth value for all pixels (0.0–1.0) +**Left Sidebar:** +- Weights drop zone (click or drag-drop `.bin` files) +- Weights info panel (layer specs, ranges, file size) +- Weights visualization (click Layer 0/1/2 buttons) + - 1 pixel per weight, all input channels horizontally + - Output channels (Out 0-3) stacked vertically + +**Center Canvas:** +- Main output view (CNN result, original, or diff) +- Keyboard: `SPACE` = original, `D` = diff (×10) -**Keyboard:** -- `SPACE` - Toggle original input view -- `D` - Toggle difference view (×10 amplification) +**Right Sidebar:** +- Layer selection buttons (Static 0-3/4-7, Layer 0/1/2) +- 4 small activation views (Ch0/1/2/3) in a row +- Large zoom view below (4× magnification, follows mouse) -**Status Bar:** -- Shows GPU timing (ms), image dimensions, and current view mode -- Red text indicates errors +**Header Controls:** +- **Blend:** Mix between original (0.0) and CNN output (1.0) +- **Depth:** Uniform depth value for all pixels (0.0–1.0) +- **View:** Current display mode -**Console Log:** -- Timestamped event log at bottom -- Tracks file loads, pipeline execution, errors -- Auto-scrolls to latest messages +**Footer:** +- Status: GPU timing (ms), image dimensions, view mode +- Console: Timestamped event log (file loads, errors) --- @@ -167,24 +177,32 @@ Open browser console (F12) for detailed errors. Common issues: --- -## TODO +## Implemented Features + +**✓ Weights Metadata Panel:** +- Layer descriptions (kernel size, channels, weight count) +- Weight statistics (min/max per layer) +- File size and layer count + +**✓ Weights Visualization:** +- Per-layer kernel heatmaps (1px/weight) +- All input channels displayed horizontally +- Output channels stacked vertically +- Normalized grayscale display -**Side Panel (Right):** -- Display .bin content metadata: - - Layer descriptions (kernel size, channels, weight count) - - Weight statistics (min/max/mean per layer) - - Weight heatmap visualization - - Binary format validation status - - Memory usage breakdown +**✓ Layer Activation Viewer:** +- Static features (8D split into 0-3 and 4-7 views) +- All CNN layer outputs (Layer 0/1/2...) +- 4-channel split view (grayscale per channel) +- Mouse-driven 4× zoom view + +## TODO -**Layer Inspection Views:** -- Split R/G/B/A plane visualization -- Intermediate layer output display: - - View static features (8D packed as heatmaps) - - View layer 0 output (before activation) - - View layer 1 output - - Toggle between channels -- Activation heatmaps (where neurons fire) +**Future Enhancements:** +- Weight distribution histograms per layer +- Activation statistics (min/max/mean overlay) +- Side-by-side diff mode (browser vs C++ output) +- Export rendered layers as PNG --- @@ -213,13 +231,15 @@ Planned enhancements: ## Size -- HTML structure: ~1 KB -- CSS styling: ~1 KB -- JavaScript logic: ~5 KB +- HTML structure: ~2 KB +- CSS styling: ~2 KB +- JavaScript logic: ~10 KB (includes zoom + weights viz) - Static shader: ~1 KB - CNN shader: ~3 KB - Display shader: ~1 KB -- **Total: ~12 KB** (single file, no dependencies) +- Layer viz shader: ~2 KB +- Zoom shader: ~1 KB +- **Total: ~22 KB** (single file, no dependencies) --- |
