summaryrefslogtreecommitdiff
path: root/cnn_v3/tools/tester.js
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3/tools/tester.js')
-rw-r--r--cnn_v3/tools/tester.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/cnn_v3/tools/tester.js b/cnn_v3/tools/tester.js
index 4286060..c1eb9f0 100644
--- a/cnn_v3/tools/tester.js
+++ b/cnn_v3/tools/tester.js
@@ -385,6 +385,7 @@ class CNNv3Tester {
this.layerTextures={feat0:f0,feat1:f1,enc0:e0,enc1:e1,bn,dec1:d1,output:ot};
this.lastResult={ot,itex:this.inputTex,uDp,dispPL:this.getDisp(),w,h};
this.updateVizPanel();
+ this.refreshZoom();
}
destroyLayerTex(){for(const t of Object.values(this.layerTextures||{}))try{t.destroy();}catch(_){} this.layerTextures={};}
@@ -492,6 +493,7 @@ class CNNv3Tester {
if (!def || !tex || !this.device) return;
const wrap = document.getElementById('chzoomWrap');
const lbl = document.getElementById('chzoomLbl');
+ this.activeZoom = {layerId, ch, label};
lbl.textContent = label;
wrap.style.display = 'flex';
// Wait for layout so clientWidth/clientHeight reflect the flex-distributed size
@@ -521,6 +523,13 @@ class CNNv3Tester {
});
}
+ refreshZoom() {
+ if (this.activeZoom) {
+ const {layerId, ch, label} = this.activeZoom;
+ this.zoomChannel(layerId, ch, label);
+ }
+ }
+
// ── Save PNG ─────────────────────────────────────────────────────────────
async savePNG() {
@@ -787,6 +796,7 @@ class CNNv3Tester {
this.layerTextures = {feat0:f0, feat1:f1, enc0:e0, enc1:e1, bn, dec1:d1, output:ot};
this.lastResult = {ot, itex:this.inputTex, uDp, dispPL:this.getDisp(), w, h};
this.updateVizPanel();
+ this.refreshZoom();
const ms = (performance.now()-t0).toFixed(1);
document.getElementById('cnnLabel').textContent = `CNN output (${ms}ms)`;