From c3e769f7c588394d90b95feec602804a2f5791e5 Mon Sep 17 00:00:00 2001 From: Krishna Penukonda Date: Sat, 28 Nov 2026 18:20:43 +0800 Subject: [PATCH] Make Stackroom heatmaps fully opaque at 100% --- bokehforge/docs/review.md | 2 +- bokehforge/src/bokehforge/review/static/score-overlay.js | 7 +++---- bokehforge/src/bokehforge/review/static/style.css | 6 +++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bokehforge/docs/review.md b/bokehforge/docs/review.md index 6d9638e..c2f3acf 100644 --- a/bokehforge/docs/review.md +++ b/bokehforge/docs/review.md @@ -30,7 +30,7 @@ For scenes with one supported RGB ground-truth image, each ready output shows th **Score details** in the sidebar shows the inferred area, resolution cap, overlap quality, and match confidence. In the lightbox, select **Explain score** to see the same details. **How alignment was inferred** shows search evidence and the score contribution of each retained placement. An unmatched delivery still has an explanation with the reason. -Use **Heatmaps** in the output sidebar or the floating controls in the lightbox when an output is selected. **Attention** shows which reference regions the scorer emphasizes, on a 0–1 scale. It is available for attention-weighted scores with an aligned output. **Damage** starts with **All damage**, which combines the six damage types using the benchmark’s weights. Select the active Damage button again to choose a type or turn the heatmap off. Use the grid button to switch between 8- and 32-pixel tiles and the slider to adjust opacity. Expand a damage family in the score details to see its pooling values and weights. +Use **Heatmaps** in the output sidebar or the floating controls in the lightbox when an output is selected. **Attention** shows which reference regions the scorer emphasizes, on a 0–1 scale. It is available for attention-weighted scores with an aligned output. **Damage** starts with **All damage**, which combines the six damage types using the benchmark’s weights. Select the active Damage button again to choose a type or turn the heatmap off. Use the grid button to switch between 8- and 32-pixel tiles. The opacity slider shows the original output at 0% and the heatmap at 100%, with the viewer matte filling areas without measurements. Expand a damage family in the score details to see its pooling values and weights. The overlay, damage type, tile size, and opacity carry over when you switch outputs or move between the main viewer and the lightbox. Heatmaps use the leading placement and load on demand. The lightbox keeps the heatmap aligned during zoom and pan and confines it to the output side of a reference swipe. The full reference stays clear for comparison. diff --git a/bokehforge/src/bokehforge/review/static/score-overlay.js b/bokehforge/src/bokehforge/review/static/score-overlay.js index 6fed706..bf600c8 100644 --- a/bokehforge/src/bokehforge/review/static/score-overlay.js +++ b/bokehforge/src/bokehforge/review/static/score-overlay.js @@ -38,14 +38,13 @@ function drawGrid(canvas, payload) { const { x_edges: xs, y_edges: ys, values, covered_pixels: coverage } = payload.grid; const colors = Array.from({ length: 256 }, (_, index) => { const t = index / 255; - return "rgba(" + Math.round(90 + 165 * t) + "," + Math.round(80 + 121 * t) + "," + - Math.round(225 - 177 * t) + "," + (0.26 + 0.57 * t) + ")"; + return `rgb(${Math.round(90 + 165 * t)}, ${Math.round(80 + 121 * t)}, ${Math.round(225 - 177 * t)})`; }); let index = 0; for (let row = 0; row < ys.length - 1; row += 1) { for (let col = 0; col < xs.length - 1; col += 1, index += 1) { const value = values[index]; - if (!value || coverage?.[index] === 0) continue; + if (value == null || coverage?.[index] === 0) continue; ctx.fillStyle = colors[Math.round(255 * Math.min(value / maximum, 1))]; ctx.fillRect(xs[col], ys[row], xs[col + 1] - xs[col], ys[row + 1] - ys[row]); } @@ -66,7 +65,7 @@ function drawAttention(canvas, payload) { image.data[offset] = 29 + 79 * value; image.data[offset + 1] = 132 + 90 * value; image.data[offset + 2] = 165 + 80 * value; - image.data[offset + 3] = 210 * value; + image.data[offset + 3] = 255; } sourceContext.putImageData(image, 0, 0); overlayContext(canvas, payload).drawImage(source, 0, 0, ...payload.reference_size_wh); diff --git a/bokehforge/src/bokehforge/review/static/style.css b/bokehforge/src/bokehforge/review/static/style.css index ca92cd9..9997744 100644 --- a/bokehforge/src/bokehforge/review/static/style.css +++ b/bokehforge/src/bokehforge/review/static/style.css @@ -520,7 +520,11 @@ body:has(#scene-browser:popover-open) #show-scenes { border-color: var(--field-s top: 3.85rem; max-height: calc(100% - 4.4rem); } -.damage-canvas { position: absolute; pointer-events: none; } +.damage-canvas { + position: absolute; + background: var(--matte); + pointer-events: none; +} .damage-legend { position: absolute; left: .55rem;