Spaces:
Running on Zero
Running on Zero
Show four decision tasks with preset LEVIR-CC image pairs
Browse filesFiles changed (4)
- workbench/index.html+18-15
- workbench/lab.css+33-11
- workbench/lab.js+83-41
- workbench/tasks.js+11-11
5 unmodified lines67891011121327 unmodified lines41424344454647486 unmodified lines5556575859606162636465666768697071727374757677785 unmodified lines<meta name="theme-color" content="#f7f8f6"><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M3 12 16 5l13 7-13 7L3 12Zm0 7 13 7 13-7' fill='none' stroke='%230f766e' stroke-width='2.5'/%3E%3C/svg%3E"><title>Critique-then-Rerank · Decision Lab</title><link rel="stylesheet" href="./workbench/lab.css?v=levir-results"><script type="module" src="./workbench/lab.js?v=levir-results"></script></head><body><header class="topbar">27 unmodified lines</aside><section class="decision panel" id="inference-panel" aria-labelledby="inference-controls-title"><div class="sectionbar"><h3 id="inference-controls-title" data-t="listTitle">From two images to one caption</h3><span class="micro">T₁ / T₂ → CAPTION</span></div><p class="explain" data-t="listIntro">Pick an image pair and run the model. Follow each decision below as it arrives.</p><details class="pair-picker"><summary data-t="pairs">Choose an image pair</summary><div class="case-grid case-options" id="case-grid"></div></details><div class="toolbar"><div class="transport"><button type="button" id="live" data-t="live">Run on GPU</button><button type="button" id="replay" data-t="play">▷ Step through</button></div></div>6 unmodified lines<a class="trace-link" href="#decision-trace" data-t="followTrace">Follow the decision trace ↓</a></section></div><div class="sectionbar archive-heading"><h2 data-t="decisionLabs">Inside the decision model</h2><span class="micro">ELEPHANT-1 / 03 LABS</span></div><section class="panel story" id="candidate-ranking" aria-labelledby="ranking-title"><div class="sectionbar"><h3 id="ranking-title" data-t="rankingTitle">01 · Candidate Ranking Explorer</h3><span class="chip" data-t="recordedExample">Benchmark example</span></div><p class="explain" data-t="rankingIntro">Beam order measures what the generator prefers. Visual reranking can find a better caption in the very same pool.</p><div id="rank-explorer"></div></section><section class="panel story" id="decision-trace" aria-labelledby="decision-title"><div class="sectionbar"><h3 id="decision-title" data-t="decisionTitle">02 · State-Routed Decision Trace</h3><span id="source" class="chip"></span></div><p class="explain" data-t="traceIntro">Stage 1 locks the state. If nothing changed, the model returns its anchor immediately; otherwise Stage 2 compares the remaining change descriptions.</p><nav class="pipeline" id="pipeline" aria-labelledby="decision-title"></nav><div id="route-branch"></div><div id="inspector" class="inspector"></div></section><section class="panel story" id="verification-lab" aria-labelledby="verification-title"><div class="sectionbar"><h3 id="verification-title" data-t="verificationTitle">03 · Counterfactual Verification Lab</h3><span class="chip" data-t="recordedExample">Benchmark example</span></div><div class="verify-grid"><div id="verify-images"></div><div id="probe"></div></div></section><details class="panel more-tasks"><summary data-t="moreTasks">Explore the other decision tasks</summary><div id="task-grid" class="view-mode"></div><div class="verify-grid"><div id="task-images"></div><div id="aux-probe"></div></div></details><p class="sr-only" id="task-announcement" role="status"></p><p id="load-error" role="status"></p><noscript>This interactive trace requires JavaScript. / 交互演示需要 JavaScript。</noscript>5 unmodified lines67891011121327 unmodified lines41424344454647486 unmodified lines5556575859606162636465666768697071727374757677787980815 unmodified lines<meta name="theme-color" content="#f7f8f6"><link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M3 12 16 5l13 7-13 7L3 12Zm0 7 13 7 13-7' fill='none' stroke='%230f766e' stroke-width='2.5'/%3E%3C/svg%3E"><title>Critique-then-Rerank · Decision Lab</title><link rel="stylesheet" href="./workbench/lab.css?v=four-decisions"><script type="module" src="./workbench/lab.js?v=four-decisions"></script></head><body><header class="topbar">27 unmodified lines</aside><section class="decision panel" id="inference-panel" aria-labelledby="inference-controls-title"><div class="sectionbar"><h3 id="inference-controls-title" data-t="listTitle">From two images to one caption</h3><span class="micro">T₁ / T₂ → CAPTION</span></div><p class="explain" data-t="listIntro">Choose a preset LEVIR-CC pair to run live. Each pair contains before and after images of the same location.</p><details class="pair-picker"><summary data-t="pairs">Browse LEVIR-CC image pairs</summary><div class="case-grid case-options" id="case-grid"></div></details><div class="toolbar"><div class="transport"><button type="button" id="live" data-t="live">Run on GPU</button><button type="button" id="replay" data-t="play">▷ Step through</button></div></div>6 unmodified lines<a class="trace-link" href="#decision-trace" data-t="followTrace">Follow the decision trace ↓</a></section></div><section class="decision-lab" aria-labelledby="tasks-title"><div class="sectionbar"><h2 id="tasks-title" data-t="decisionLabs">One model, four decisions</h2><span class="micro">ELEPHANT-1 / LEVIR-CC</span></div><p class="explain" data-t="decisionIntro">Explore how Elephant-1 detects change, verifies a caption, compares two captions, and selects from the Beam-15 pool. These examples don’t use GPU quota.</p><div class="task-tabs" id="task-grid" role="tablist" aria-labelledby="tasks-title"><button type="button" id="task-tab-state" role="tab" data-task="0" aria-selected="true"><small>01</small><strong data-t="taskState">Change state</strong><span data-t="taskStateHint">Images only</span></button><button type="button" id="task-tab-verify" role="tab" data-task="1" aria-selected="false" tabindex="-1"><small>02</small><strong data-t="taskVerify">Caption verification</strong><span data-t="taskVerifyHint">Yes / No</span></button><button type="button" id="task-tab-pair" role="tab" data-task="2" aria-selected="false" tabindex="-1"><small>03</small><strong data-t="taskPair">Pairwise preference</strong><span>A / B</span></button><button type="button" id="task-tab-list" role="tab" data-task="3" aria-selected="false" tabindex="-1"><small>04</small><strong data-t="taskList">Listwise selection</strong><span>Beam-15</span></button></div><div role="tabpanel" aria-labelledby="task-tab-state" id="task-state" tabindex="0"><article class="panel story task-card verify-grid"><div id="state-images"></div><div id="state-probe"></div></article></div><div role="tabpanel" aria-labelledby="task-tab-verify" id="task-verify" hidden><article class="panel story task-card verify-grid"><div id="verify-images"></div><div id="probe"></div></article></div><div role="tabpanel" aria-labelledby="task-tab-pair" id="task-pair" hidden><article class="panel story task-card verify-grid"><div id="task-images"></div><div id="aux-probe"></div></article></div><div role="tabpanel" aria-labelledby="task-tab-list" id="candidate-ranking" hidden><article class="panel story task-card" id="rank-explorer"></article></div></section><section class="panel story" id="decision-trace" aria-labelledby="decision-title"><div class="sectionbar"><h3 id="decision-title" data-t="decisionTitle">State-Routed Decision Trace</h3><span id="source" class="chip"></span></div><p class="explain" data-t="traceIntro">Stage 1 locks the state. If nothing changed, the model returns its anchor immediately; otherwise Stage 2 compares the remaining change descriptions.</p><nav class="pipeline" id="pipeline" aria-labelledby="decision-title"></nav><div id="route-branch"></div><div id="inspector" class="inspector"></div></section><p class="sr-only" id="task-announcement" role="status"></p><p id="load-error" role="status"></p><noscript>This interactive trace requires JavaScript. / 交互演示需要 JavaScript。</noscript>
63 unmodified lines646566676869707172737475767778798081828384858687888990919260 unmodified lines1531541551561571581593 unmodified lines16316416516616716816917017117274 unmodified lines24724824925025125225325463 unmodified lines.metric small, .metric span { color: var(--dim); }.metric strong { color: var(--ink); }.metric b { color: var(--green); font: 600 .75rem var(--mono); }.inference-heading, .archive-heading { margin-top: clamp(30px, 4vw, 52px); }.inference-heading h2, .archive-heading h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }.story { margin-bottom: 14px; }.story h3, .decision .sectionbar h3 { font-size: clamp(1.1rem, 2vw, 1.38rem); }.verify-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: clamp(12px, 2vw, 28px); }.verify-grid > div { min-width: 0; }.rank-jump { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; color: var(--dim); }.rank-jump strong { font: 700 clamp(1.4rem, 3vw, 2.35rem)/1.15 var(--mono); color: var(--green); }.explorer-pool { grid-auto-rows: min-content; }.explorer-pool .slot { grid-template-columns: 20px minmax(0, 1fr) auto; }.run-caption { display: grid; gap: 5px; border: 1px solid var(--green); border-radius: 8px; background: var(--green-wash); padding: 12px; margin-bottom: 12px; }.run-caption small, .mapping { color: var(--green); font: .72rem var(--mono); }.mapping { margin-block: 10px; }.trace-link { display: inline-flex; align-items: center; min-height: 32px; font-size: .87rem; }.more-tasks { margin-bottom: 28px; }.more-tasks .view-mode { margin-block: 10px; }#load-error:empty { display: none; }.case { position: relative; display: grid; grid-template-columns: 57px minmax(0,1fr); align-items: center; gap: 10px; min-height: 80px; text-align: start; padding: 9px; background: var(--panel); }.case img { border-radius: 4px; }.case-number { position: absolute; inset: 13px auto auto 13px; background: var(--panel); color: var(--ink); border-radius: 3px; padding: 2px 3px; font: .61rem var(--mono); }.case[aria-pressed='true'] { background: var(--green-wash); box-shadow: inset 0 -2px var(--green); }.case strong { display: block; font-size: .88rem; line-height: 1.25; }.case small { display: block; font: .67rem var(--mono); color: var(--dim); margin-top: 5px; }.lab { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.42fr); align-items: start; gap: 16px; margin-block: 18px 32px; }.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: clamp(13px, 1.8vw, 24px); min-width: 0; }.view-mode, .toolbar, .transport { display: flex; flex-wrap: wrap; gap: 7px; }60 unmodified lines.inspect-head h3 { font-size: clamp(1.4rem, 2.1vw, 2rem); line-height: 1.13; margin-block: 4px 6px; letter-spacing: -.036em; }.inspect-head time { color: var(--green); white-space: nowrap; }.explain { margin-bottom: 13px; }.probe-question { font-size: clamp(1.4rem, 3vw, 2.25rem); line-height: 1.14; letter-spacing: -.035em; margin-block: 8px; }.protocol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-block: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--line); overflow: hidden; }.protocol > div { display: grid; align-content: start; gap: 5px; background: var(--deep); padding: 10px; }.protocol small { color: var(--green); font: .72rem/1.3 var(--mono); }3 unmodified lines.probe-option { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; row-gap: 4px; border: 1px solid var(--line); padding: 10px 12px; border-radius: 7px; background: var(--deep); font-size: .91rem; line-height: 1.4; }.probe-option span { flex: 1 1 130px; }.probe-option code { color: var(--dim); }.probe-option strong { color: var(--green); font: 600 .76rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }.probe-picked { border-color: var(--green); background: var(--green-wash); }.pair-picker { margin-block: 12px; }.case-options { margin-top: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 178px), 1fr)); }.route-map { margin-block: 16px 12px; }.route-root { margin-inline: auto; width: max-content; display: grid; text-align: center; gap: 3px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 15px; background: var(--deep); }.route-root span { color: var(--dim); }74 unmodified lines.toplinks { gap: 6px; }.wordmark { font-size: .82rem; }.wordmark small, .toplinks a { font-size: .66rem; }.case { grid-template-columns: 38px minmax(0,1fr); padding: 6px; gap: 6px; }.case-number { inset: 19px auto auto 7px; }.protocol > div { padding: 8px 6px; }.live-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }.live-nodes li:nth-child(n)::after { display: none; }63 unmodified lines64656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610760 unmodified lines1681691701711721731743 unmodified lines17817918018118218318418518618718818919019119219319419574 unmodified lines27027127227327427527663 unmodified lines.metric small, .metric span { color: var(--dim); }.metric strong { color: var(--ink); }.metric b { color: var(--green); font: 600 .75rem var(--mono); }.inference-heading, .decision-lab { margin-top: clamp(30px, 4vw, 52px); }.inference-heading h2, .decision-lab h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }.story { margin-bottom: 14px; }.story h3, .decision .sectionbar h3 { font-size: clamp(1.1rem, 2vw, 1.38rem); }.decision-lab { margin-bottom: 26px; }.task-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px; margin: -4px -4px 8px; }.task-tabs button { position: relative; flex: 1 0 138px; min-width: 0; min-height: 81px; display: grid; align-content: start; gap: 4px; padding: 10px 12px; text-align: start; border-color: var(--line); background: var(--panel); }.task-tabs button[aria-selected='true'] { background: var(--green-wash); border-color: var(--green); }.task-tabs button[aria-selected='true']::after { content: ''; position: absolute; inset: auto 11px 4px; border-block-end: 2px solid var(--green); }.task-tabs small { font: .7rem var(--mono); color: var(--green); }.task-tabs strong { font-size: .88rem; line-height: 1.2; }.task-tabs button > span { color: var(--dim); font-size: .71rem; }.task-card { padding: clamp(14px, 2.2vw, 28px); }.task-evidence { margin: 0 0 10px; }.task-evidence .pair { margin-top: 8px; }.task-evidence .frame { background: var(--deep); }.task-evidence .frame img { max-width: 100%; }.verify-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: clamp(12px, 2vw, 28px); }.verify-grid > div { min-width: 0; }.rank-jump { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; color: var(--dim); }.rank-jump strong { font: 700 clamp(1.4rem, 3vw, 2.35rem)/1.15 var(--mono); color: var(--green); }.explorer-pool { grid-auto-rows: min-content; }.explorer-pool .slot { grid-template-columns: 20px minmax(0, 1fr) auto; }.explorer-score { text-align: end; }.explorer-verdict { margin: 10px 0 8px; color: var(--green); font-weight: 700; }.run-caption { display: grid; gap: 5px; border: 1px solid var(--green); border-radius: 8px; background: var(--green-wash); padding: 12px; margin-bottom: 12px; }.run-caption small, .mapping { color: var(--green); font: .72rem var(--mono); }.mapping { margin-block: 10px; }.trace-link { display: inline-flex; align-items: center; min-height: 32px; font-size: .87rem; }#load-error:empty { display: none; }.case { display: grid; align-content: start; gap: 8px; text-align: start; padding: 8px; background: var(--panel); }.case img { border-radius: 4px; }.case-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }.case-thumbs img { aspect-ratio: 1; }.case[aria-pressed='true'] { background: var(--green-wash); box-shadow: inset 0 -2px var(--green); }.case strong { display: block; font-size: .88rem; line-height: 1.25; }.case small { display: block; font: .67rem var(--mono); color: var(--dim); margin-top: 4px; }.case-thumbs small { margin-top: 2px; }.lab { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.42fr); align-items: start; gap: 16px; margin-block: 18px 32px; }.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: clamp(13px, 1.8vw, 24px); min-width: 0; }.view-mode, .toolbar, .transport { display: flex; flex-wrap: wrap; gap: 7px; }60 unmodified lines.inspect-head h3 { font-size: clamp(1.4rem, 2.1vw, 2rem); line-height: 1.13; margin-block: 4px 6px; letter-spacing: -.036em; }.inspect-head time { color: var(--green); white-space: nowrap; }.explain { margin-bottom: 13px; }.task-card .probe-question { font-size: clamp(1.4rem, 3vw, 2.25rem); line-height: 1.14; letter-spacing: -.035em; margin-block: 0 8px; }.protocol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-block: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--line); overflow: hidden; }.protocol > div { display: grid; align-content: start; gap: 5px; background: var(--deep); padding: 10px; }.protocol small { color: var(--green); font: .72rem/1.3 var(--mono); }3 unmodified lines.probe-option { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; row-gap: 4px; border: 1px solid var(--line); padding: 10px 12px; border-radius: 7px; background: var(--deep); font-size: .91rem; line-height: 1.4; }.probe-option span { flex: 1 1 130px; }.probe-option code { color: var(--dim); }.probe-option small { color: var(--dim); font: .76rem/1.4 var(--mono); }.probe-option strong { color: var(--green); font: 600 .76rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }.probe-option meter { flex: 1 0 100%; width: 100%; height: .55rem; }.probe-option meter::-webkit-meter-optimum-value { background: #60877b; }.probe-option meter::-moz-meter-bar { background: #60877b; }.probe-picked meter::-webkit-meter-optimum-value { background: var(--green); }.probe-picked meter::-moz-meter-bar { background: var(--green); }.probe-picked { border-color: var(--green); background: var(--green-wash); }.probe-conflict { border-color: var(--warm); background: var(--warm-wash); }.probe-conflict strong { color: var(--warm); }.pair-picker { margin-block: 12px; }.case-options { margin-top: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 129px), 1fr)); }.route-map { margin-block: 16px 12px; }.route-root { margin-inline: auto; width: max-content; display: grid; text-align: center; gap: 3px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 15px; background: var(--deep); }.route-root span { color: var(--dim); }74 unmodified lines.toplinks { gap: 6px; }.wordmark { font-size: .82rem; }.wordmark small, .toplinks a { font-size: .66rem; }.case { padding: 6px; gap: 6px; }.protocol > div { padding: 8px 6px; }.live-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }.live-nodes li:nth-child(n)::after { display: none; }
123420 unmodified lines2526272829303132333435368 unmodified lines454647484950518 unmodified lines6061626364656667686970717273747576777879808182838485868788899091929394959 unmodified lines105106107108109110111323 unmodified lines43543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247339 unmodified lines513514515516517518519520521import { probeContent, tasks } from './tasks.js';const byId = id => document.getElementById(id);const escape = value => String(value ?? '').replace(/[&<>"']/g, char => ({'&':'&', '<':'<', '>':'>', '"':'"', "'":'''}[char]));20 unmodified linesobservations: ['Bi-temporal observations','双时相观测'], trace: ['Live GPU Inference','GPU 实时推理'],openInference: ['Live GPU Inference','GPU 实时推理'], inferencePath: ['Image pair → Beam-15 → Final caption','双时相影像 → Beam-15 → 最终描述'],results: ['Benchmark results','基准成果'], baseline: ['SCST Beam-15 Top-1 → Critique-then-Rerank','SCST Beam-15 首选 → 两阶段重排'],listTitle: ['From two images to one caption','从双时相影像到变化描述'], listIntro: ['Pick an image pair and run the model. Follow each decision below as it arrives.','选择一组影像并开始推理,下方会随结果到达逐步点亮决策路径。'],pairs: ['Choose an image pair','选择示例影像'], followTrace: ['Follow the decision trace ↓','查看决策过程 ↓'],decisionLabs: ['Inside the decision model','模型如何做决策'], recordedExample: ['Benchmark example','基准示例'],rankingTitle: ['01 · Candidate Ranking Explorer','01 · 候选排序探索'], rankingIntro: ['Beam order measures what the generator prefers. Visual reranking can find a better caption in the very same pool.','Beam 排名反映生成器的偏好;视觉重排能从同一组候选中选出更符合影像的描述。'],decisionTitle: ['02 · State-Routed Decision Trace','02 · 状态分流与决策过程'], traceIntro: ['Stage 1 locks the state. If nothing changed, the model returns its anchor immediately; otherwise Stage 2 compares the remaining change descriptions.','第一阶段锁定变化状态。无变化时直接返回锚点;有变化时才进入第二阶段比较剩余的变化描述。'],verificationTitle: ['03 · Counterfactual Verification Lab','03 · 反事实核验实验室'], moreTasks: ['Explore the other decision tasks','查看其他决策任务'],encode: ['Encode the pair','编码双图'], generate: ['Generate Beam-15','生成 Beam-15'], score: ['Score all candidates','全候选评分'], lock: ['Route by state','按状态分流'], filter: ['Filter the pool','过滤候选池'],rerank: ['Compare + calibrate','精排与长度校准'], output: ['Map to original Beam ID','回映原始 Beam ID'],play: ['▷ Step through','▷ 逐步演示'], pause: ['Ⅱ Pause','Ⅱ 暂停演示'], live: ['Run on GPU','开始 GPU 推理'],8 unmodified lineslet catalog, selected, trace, phase = 3, mode = 'archive', liveEvent, busy = false, follow = true, failure = null, timer;let liveActivity, runTimes, clockTimer;let view = 'swipe', divider = 50, beta = 0.12;let activeTask = 0, alternate = false, verifySwap = false, rankedView = false;function translate() {document.documentElement.lang = text('en','zh-CN');8 unmodified linesconst rankLabel = index => `#${String(index + 1).padStart(2, '0')}`;const image = (path, later) => `<img src="${media(path)}" width="256" height="256" alt="${later ? text('T₂: later satellite image','T₂:后一时相遥感影像') : text('T₁: earlier satellite image','T₁:前一时相遥感影像')}">`;function renderTasks() {byId('task-grid').innerHTML = [0, 2].map(index => `<button type="button" data-task="${index}" aria-pressed="${index === activeTask}">${text(...tasks[index].label)}</button>`).join('');const current = activeTask === 0 ? catalog.cases.find(item => item.name === 'test_000033.png') : catalog.task_pairs['000109'];byId('task-images').innerHTML = pair(current);byId('aux-probe').innerHTML = probeContent(activeTask, alternate, text);}const frame = (path, later) => `<div class="frame">${image(path, later)}<span>${later ? 'T₂' : 'T₁'}</span></div>`;const pair = item => `<div class="pair">${item.media.map((path, index) => frame(path, index === 1)).join('')}</div>`;function renderExplorer() {const example = catalog.cases.find(item => item.name === 'test_000125.png');const {captions, final, stage2} = example.replay;const order = rankedView ? calibrated(stage2, captions, catalog.beta).map(candidate => candidate.index) : captions.map((_, index) => index);byId('rank-explorer').innerHTML = `<div class="verify-grid"><div><div class="rank-jump"><strong>15 <span aria-hidden="true">→</span> 1</strong><span>${text('Beam rank → final rank','原始 Beam 排名 → 最终排名')}</span></div>${pair(example)}<blockquote lang="en">${escape(captions[final])}</blockquote><p class="fine">LEVIR-CC · ${escape(example.name)} · β = ${catalog.beta.toFixed(2)}</p></div><div><div class="view-mode" role="group" aria-label="${text('Ranking order','排序方式')}"><button type="button" data-rank="0" aria-pressed="${!rankedView}">${text('Generator order','生成器排序')}</button><button type="button" data-rank="1" aria-pressed="${rankedView}">${text('Reranked order','视觉重排后')}</button></div><ol class="pool explorer-pool">${order.map((index, rank) => `<li class="slot ${index === final ? 'winner' : ''}"><code>${rank + 1}</code><span lang="en">${escape(captions[index])}</span><code>Beam ${rankLabel(index)}</code></li>`).join('')}</ol></div></div>`;const pool = byId('rank-explorer').querySelector('.pool');if (!rankedView) pool.scrollTop = pool.scrollHeight;}function renderVerification() {byId('verify-images').innerHTML = pair(catalog.task_pairs[verifySwap ? '000400' : '000325']);byId('probe').innerHTML = probeContent(1, verifySwap, text);}function renderCases() {byId('case-grid').innerHTML = catalog.cases.map((item, index) => `<button type="button" class="case" data-case="${index}" aria-pressed="${item === selected}" ${busy ? 'disabled' : ''}><span class="case-number">0${index + 1}</span>${image(item.media[1], true).replace(/alt="[^"]*"/, 'alt=""')}<span><strong>${escape(text(item.en, item.zh))}</strong><small>${escape(item.name.replace('.png',''))}</small></span></button>`).join('');}9 unmodified linesif (view === 'pair') stage = `<div class="pair">${frame(before, false)}${frame(after, true)}</div>`;if (view === 'video') stage = `<video controls playsinline preload="metadata" poster="${media(before)}" src="${media(current.clip)}" aria-label="${text('T₁ to T₂ playback','T₁ 到 T₂ 时序播放')}"></video><p class="fine">${text('Original frames only · 2 s per observation','仅播放两张原始影像 · 每个时相 2 秒')}</p>`;byId('viewer').innerHTML = `<div class="view-mode">${modes.map(([key, title]) => `<button type="button" data-view="${key}" aria-pressed="${view === key}">${title}</button>`).join('')}</div>${stage}`;byId('case-context').innerHTML = `<span class="micro">${text('EXAMPLE PAIR','示例影像')}</span><h3>${escape(text(selected.title_en, selected.title_zh))}</h3>`;}function select(index) {323 unmodified lineselse url.searchParams.delete('lang');history.replaceState(null, '', url);translate();if (catalog) { renderCases(); renderViewer(); renderExplorer(); renderVerification(); renderTasks(); render(); }});byId('task-grid').addEventListener('click', event => {const button = event.target.closest('[data-task]');if (!button || !catalog || Number(button.dataset.task) === activeTask) return;activeTask = Number(button.dataset.task);alternate = false;renderTasks();byId('task-grid').querySelector(`[data-task="${activeTask}"]`)?.focus({preventScroll:true});});byId('probe').addEventListener('click', event => {const button = event.target.closest('[data-variant]');if (!button || (button.dataset.variant === '1') === verifySwap) return;verifySwap = button.dataset.variant === '1';renderVerification();byId('probe').querySelector(`[data-variant="${Number(verifySwap)}"]`).focus({preventScroll:true});byId('task-announcement').textContent = byId('probe').querySelector('.probe-picked').textContent;});byId('aux-probe').addEventListener('click', event => {const button = event.target.closest('[data-variant]');if (!button || (button.dataset.variant === '1') === alternate) return;alternate = button.dataset.variant === '1';renderTasks();byId('aux-probe').querySelector(`[data-variant="${Number(alternate)}"]`).focus({preventScroll:true});byId('task-announcement').textContent = byId('aux-probe').querySelector('.probe-picked').textContent;});byId('rank-explorer').addEventListener('click', event => {const button = event.target.closest('[data-rank]');if (!button || (button.dataset.rank === '1') === rankedView) return;rankedView = button.dataset.rank === '1';renderExplorer();byId('rank-explorer').querySelector(`[data-rank="${Number(rankedView)}"]`).focus({preventScroll:true});});byId('case-grid').addEventListener('click', event => {const button = event.target.closest('[data-case]');39 unmodified linesconst response = await fetch('./catalog');if (!response.ok) throw new Error('Catalog unavailable');catalog = await response.json();select(0);renderExplorer();renderVerification();renderTasks();if (location.hash === inferenceHash) byId('trace-title').scrollIntoView();} catch {123420 unmodified lines252627282930313233343536378 unmodified lines4647484950515253548 unmodified lines636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261279 unmodified lines137138139140141142143323 unmodified lines46746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551639 unmodified lines556557558559560561562563import { probeContent, protocol, tasks } from './tasks.js?v=four-decisions';const byId = id => document.getElementById(id);const escape = value => String(value ?? '').replace(/[&<>"']/g, char => ({'&':'&', '<':'<', '>':'>', '"':'"', "'":'''}[char]));20 unmodified linesobservations: ['Bi-temporal observations','双时相观测'], trace: ['Live GPU Inference','GPU 实时推理'],openInference: ['Live GPU Inference','GPU 实时推理'], inferencePath: ['Image pair → Beam-15 → Final caption','双时相影像 → Beam-15 → 最终描述'],results: ['Benchmark results','基准成果'], baseline: ['SCST Beam-15 Top-1 → Critique-then-Rerank','SCST Beam-15 首选 → 两阶段重排'],listTitle: ['From two images to one caption','从双时相影像到变化描述'], listIntro: ['Choose a preset LEVIR-CC pair to run live. Each pair contains before and after images of the same location.','选择一组 LEVIR-CC 预置影像即可开始实时推理。每组都是同一地点的前后两期影像。'],pairs: ['Browse LEVIR-CC image pairs','浏览 LEVIR-CC 双时相影像'], followTrace: ['Follow the decision trace ↓','查看决策过程 ↓'],decisionLabs: ['One model, four decisions','一个模型,四项决策任务'],decisionIntro: ['Explore how Elephant-1 detects change, verifies a caption, compares two captions, and selects from the Beam-15 pool. These examples don’t use GPU quota.','看 Elephant-1 如何判断变化、核验描述、比较两句描述,以及从 Beam-15 候选池中选出最终描述。浏览示例不消耗 GPU 配额。'],taskState: tasks[0].label, taskVerify: ['Caption verification','描述核验'], taskPair: tasks[2].label, taskList: tasks[3].label,taskStateHint: ['Images only','仅输入影像'], taskVerifyHint: ['Yes / No','支持 / 不支持'],decisionTitle: ['State-Routed Decision Trace','状态分流与决策过程'], traceIntro: ['Stage 1 locks the state. If nothing changed, the model returns its anchor immediately; otherwise Stage 2 compares the remaining change descriptions.','第一阶段锁定变化状态。无变化时直接返回锚点;有变化时才进入第二阶段比较剩余的变化描述。'],encode: ['Encode the pair','编码双图'], generate: ['Generate Beam-15','生成 Beam-15'], score: ['Score all candidates','全候选评分'], lock: ['Route by state','按状态分流'], filter: ['Filter the pool','过滤候选池'],rerank: ['Compare + calibrate','精排与长度校准'], output: ['Map to original Beam ID','回映原始 Beam ID'],play: ['▷ Step through','▷ 逐步演示'], pause: ['Ⅱ Pause','Ⅱ 暂停演示'], live: ['Run on GPU','开始 GPU 推理'],8 unmodified lineslet catalog, selected, trace, phase = 3, mode = 'archive', liveEvent, busy = false, follow = true, failure = null, timer;let liveActivity, runTimes, clockTimer;let view = 'swipe', divider = 50, beta = 0.12;let activeTask = 0, orderSwap = false, verifySwap = false, rankedView = false, explorerBeta;const taskPanels = ['task-state', 'task-verify', 'task-pair', 'candidate-ranking'];const taskTabs = [...byId('task-grid').querySelectorAll('[role="tab"]')];function translate() {document.documentElement.lang = text('en','zh-CN');8 unmodified linesconst rankLabel = index => `#${String(index + 1).padStart(2, '0')}`;const image = (path, later) => `<img src="${media(path)}" width="256" height="256" alt="${later ? text('T₂: later satellite image','T₂:后一时相遥感影像') : text('T₁: earlier satellite image','T₁:前一时相遥感影像')}">`;const frame = (path, later) => `<div class="frame">${image(path, later)}<span>${later ? 'T₂' : 'T₁'}</span></div>`;const pair = item => `<div class="pair">${item.media.map((path, index) => frame(path, index === 1)).join('')}</div>`;const evidence = item => `<figure class="task-evidence"><span class="micro">${text('VISUAL EVIDENCE','影像证据')}</span>${pair(item)}<figcaption class="fine">LEVIR-CC · ${escape(item.name)}</figcaption></figure>`;function selectTask(index) {activeTask = index;taskTabs.forEach((button, position) => {const current = index === position;button.setAttribute('aria-selected', current);button.tabIndex = current ? 0 : -1;byId(taskPanels[position]).hidden = !current;if (position === 0) {if (current) byId(taskPanels[position]).tabIndex = 0;else byId(taskPanels[position]).removeAttribute('tabindex');}});taskTabs[index].focus({preventScroll:true});taskTabs[index].scrollIntoView({block:'nearest', inline:'nearest', container:'nearest'});}function renderExplorer() {const example = catalog.cases.find(item => item.name === 'test_000125.png');const {captions, final} = example.replay;byId('rank-explorer').innerHTML = `<div class="verify-grid"><div>${evidence(example)}<div class="rank-jump"><strong>${final + 1} → 1</strong><span>${text('Beam rank → final rank','原始 Beam 排名 → 最终排名')} · β = ${catalog.beta.toFixed(2)}</span></div><blockquote lang="en">${escape(captions[final])}</blockquote></div><div><h3 class="probe-question">${text(...tasks[3].hint)}</h3><p class="explain">${text('Compare the generator order with the visual reranking of the same pool. Then vary β to see how caption length changes the decision.', '对比同一组候选的生成器排序和视觉重排,再调节 β,观察句长如何影响结果。')}</p>${protocol(tasks[3], text)}<div class="view-mode" role="group" aria-label="${text('Ranking order','排序方式')}"><button type="button" data-rank="0" aria-pressed="${!rankedView}">${text('Generator order','生成器排序')}</button><button type="button" data-rank="1" aria-pressed="${rankedView}">${text('Reranked order','视觉重排后')}</button></div><div class="formula explorer-formula"><code>log(max(P(slot), 10⁻³⁰)) − β × words</code><label class="range-label" for="explorer-beta">${text('Length penalty β','长度惩罚 β')}<output id="explorer-beta-value" for="explorer-beta">${explorerBeta.toFixed(2)}</output></label><input id="explorer-beta" type="range" min="0" max="0.20" step="0.02" value="${explorerBeta}"></div><p class="fine explorer-verdict" id="explorer-winner" role="status"></p><ol class="pool explorer-pool" id="explorer-pool"></ol></div></div>`;updateExplorer(example);}function updateExplorer(example) {const {captions, stage2} = example.replay;const ranked = calibrated(stage2, captions, explorerBeta);const winner = ranked[0].index;const order = rankedView ? ranked.map(candidate => candidate.index) : captions.map((_, index) => index);const scores = new Map(ranked.map(candidate => [candidate.index, candidate.score]));byId('explorer-beta-value').textContent = explorerBeta.toFixed(2);byId('explorer-beta').setAttribute('aria-valuetext', explorerBeta.toFixed(2));byId('explorer-winner').textContent = text(`At β = ${explorerBeta.toFixed(2)}: Beam ${rankLabel(winner)} wins.`, `β = ${explorerBeta.toFixed(2)} 时:选中 Beam ${rankLabel(winner)}。`);for (const button of byId('rank-explorer').querySelectorAll('[data-rank]')) button.setAttribute('aria-pressed', (button.dataset.rank === '1') === rankedView);byId('explorer-pool').innerHTML = order.map((index, rank) => `<li class="slot ${index === winner ? 'winner' : ''}"><code>${rank + 1}</code><span lang="en">${escape(captions[index])}</span><div class="explorer-score"><code>Beam ${rankLabel(index)}</code>${rankedView ? `<small>${scores.get(index).toFixed(4)}</small>` : ''}</div></li>`).join('');byId('explorer-pool').scrollTop = 0;}function renderTasks() {byId('state-images').innerHTML = evidence(catalog.cases.find(item => item.name === 'test_000033.png'));byId('state-probe').innerHTML = probeContent(0, false, text);byId('verify-images').innerHTML = evidence(catalog.task_pairs[verifySwap ? '000400' : '000325']);byId('probe').innerHTML = probeContent(1, verifySwap, text);byId('task-images').innerHTML = evidence(catalog.task_pairs['000109']);byId('aux-probe').innerHTML = probeContent(2, orderSwap, text);renderExplorer();}function renderCases() {byId('case-grid').innerHTML = catalog.cases.map((item, index) => `<button type="button" class="case" data-case="${index}" aria-pressed="${item === selected}" ${busy ? 'disabled' : ''}><span class="case-thumbs" aria-hidden="true">${item.media.map((path, period) => `<span><img src="${media(path)}" width="256" height="256" alt=""><small>${period ? 'T₂' : 'T₁'}</small></span>`).join('')}</span><span><strong>${escape(text(item.en, item.zh))}</strong><small>${escape(item.name.replace('.png',''))}</small></span></button>`).join('');}9 unmodified linesif (view === 'pair') stage = `<div class="pair">${frame(before, false)}${frame(after, true)}</div>`;if (view === 'video') stage = `<video controls playsinline preload="metadata" poster="${media(before)}" src="${media(current.clip)}" aria-label="${text('T₁ to T₂ playback','T₁ 到 T₂ 时序播放')}"></video><p class="fine">${text('Original frames only · 2 s per observation','仅播放两张原始影像 · 每个时相 2 秒')}</p>`;byId('viewer').innerHTML = `<div class="view-mode">${modes.map(([key, title]) => `<button type="button" data-view="${key}" aria-pressed="${view === key}">${title}</button>`).join('')}</div>${stage}`;byId('case-context').innerHTML = `<span class="micro">LEVIR-CC · ${text('PRESET PAIR','预置影像')}</span><h3>${escape(text(selected.title_en, selected.title_zh))}</h3>`;}function select(index) {323 unmodified lineselse url.searchParams.delete('lang');history.replaceState(null, '', url);translate();if (catalog) { renderCases(); renderViewer(); renderTasks(); render(); }});byId('task-grid').addEventListener('click', event => {const button = event.target.closest('[data-task]');if (!button || !catalog || Number(button.dataset.task) === activeTask) return;selectTask(Number(button.dataset.task));});byId('task-grid').addEventListener('keydown', event => {if (!catalog || !event.target.closest('[data-task]')) return;const count = taskTabs.length;const next = {ArrowLeft:(activeTask + count - 1) % count, ArrowRight:(activeTask + 1) % count, Home:0, End:count - 1}[event.key];if (next === undefined) return;event.preventDefault();selectTask(next);});byId('probe').addEventListener('click', event => {const button = event.target.closest('[data-variant]');if (!button || (button.dataset.variant === '1') === verifySwap) return;verifySwap = button.dataset.variant === '1';byId('verify-images').innerHTML = evidence(catalog.task_pairs[verifySwap ? '000400' : '000325']);byId('probe').innerHTML = probeContent(1, verifySwap, text);byId('probe').querySelector(`[data-variant="${Number(verifySwap)}"]`).focus({preventScroll:true});byId('task-announcement').textContent = byId('probe').querySelector('.probe-picked').textContent;});byId('aux-probe').addEventListener('click', event => {const button = event.target.closest('[data-variant]');if (!button || (button.dataset.variant === '1') === orderSwap) return;orderSwap = button.dataset.variant === '1';byId('aux-probe').innerHTML = probeContent(2, orderSwap, text);byId('aux-probe').querySelector(`[data-variant="${Number(orderSwap)}"]`).focus({preventScroll:true});byId('task-announcement').textContent = byId('aux-probe').querySelector('.probe-picked').textContent;});byId('rank-explorer').addEventListener('click', event => {const button = event.target.closest('[data-rank]');if (!button || (button.dataset.rank === '1') === rankedView) return;rankedView = button.dataset.rank === '1';updateExplorer(catalog.cases.find(item => item.name === 'test_000125.png'));});byId('rank-explorer').addEventListener('input', event => {if (event.target.id !== 'explorer-beta') return;explorerBeta = Number(event.target.value);rankedView = true;updateExplorer(catalog.cases.find(item => item.name === 'test_000125.png'));});byId('case-grid').addEventListener('click', event => {const button = event.target.closest('[data-case]');39 unmodified linesconst response = await fetch('./catalog');if (!response.ok) throw new Error('Catalog unavailable');catalog = await response.json();explorerBeta = catalog.beta;select(0);renderTasks();if (location.hash === inferenceHash) byId('trace-title').scrollIntoView();} catch {
12345671 unmodified line91011121314151 unmodified line171819202122231 unmodified line252627282930318 unmodified lines4041424344454647484950515253545556575859606162export const tasks = [{label: ['Change state','变化状态'],hint: ['Did anything change?','场景变了吗?'],input: ['T₁ + T₂ only','只输入 T₁ 和 T₂'],output: ['Changed / Unchanged','有变化 / 无变化'],role: ['Stage 1 warm-start and auxiliary training','第一阶段预热与辅助训练'],1 unmodified line},{label: ['Caption factuality','事实核验'],hint: ['Is this caption true?','这句描述属实吗?'],input: ['T₁ + T₂ + one fixed caption','双图 + 一句固定描述'],output: ['Yes / No','支持 / 不支持'],role: ['Stage 2 verification training','第二阶段事实核验训练'],1 unmodified line},{label: ['Pairwise preference','成对偏好'],hint: ['Which of two captions fits?','两句里哪句更准确?'],input: ['T₁ + T₂ + captions A and B','双图 + A、B 两句描述'],output: ['A / B','选 A 或 B'],role: ['Stage 1 auxiliary training','第一阶段辅助训练'],1 unmodified line},{label: ['Listwise selection','列表选句'],hint: ['Which candidate is best?','整组候选里哪句最好?'],input: ['T₁ + T₂ + a caption list','双图 + 一组候选描述'],output: ['One caption from the list','从列表选出一句'],role: ['Stage 1 and Stage 2 inference','两阶段正式推理'],8 unmodified linesexport function probeContent(index, alternate, text) {const task = tasks[index];const choose = text('Selected','选中');const option = (key, label, selected, probability) => `<li class="probe-option${selected ? ' probe-picked' : ''}">${key ? `<code>${key}</code>` : ''}<span${key ? ' lang="en"' : ''}>${label}</span>${selected ? `<strong>${choose}${probability ? ` · ${probability}` : ''}</strong>` : ''}</li>`;let controls = '';let options;if (index === 0) {options = [option('',text('Changed','有变化'),false), option('',text('Unchanged','无变化'),true,'92.4%')];} else if (index === 1) {controls = `<blockquote lang="en">houses are built along the road and some brushwoods disappear</blockquote>` +switches(text('Choose the image evidence','切换影像证据'), text('Matching images','支持描述的影像'), text('Different images','另一组影像'), alternate);options = [option('',text('Yes','支持'),!alternate,'P(Yes) > 99.9%'), option('',text('No','不支持'),alternate,'P(Yes) < 0.1%')];} else {controls = switches(text('Choose candidate order','切换选项顺序'), text('Original A/B','原顺序 A/B'), text('Swap A/B','交换 A/B'), alternate);const house = 'houses are built in an open space';const unchanged = 'no change has occurred';options = [option('A',alternate ? unchanged : house,!alternate,'96.9%'), option('B',alternate ? house : unchanged,alternate,'91.5%')];}return `<h4 class="probe-question">${text(...task.hint)}</h4><p class="explain">${text(...task.explanation)}</p>${protocol(task, text)}${controls}<div class="pool-head">${text('Example decision','示例决策')}</div><ul class="probe-options" role="list">${options.join('')}</ul>`;}function switches(label, first, second, alternate) {12345671 unmodified line91011121314151 unmodified line171819202122231 unmodified line252627282930318 unmodified lines4041424344454647484950515253545556575859606162export const tasks = [{label: ['Change state','变化状态'],hint: ['Did the scene physically change?','场景本身发生变化了吗?'],input: ['T₁ + T₂ only','只输入 T₁ 和 T₂'],output: ['Changed / Unchanged','有变化 / 无变化'],role: ['Stage 1 warm-start and auxiliary training','第一阶段预热与辅助训练'],1 unmodified line},{label: ['Caption factuality','事实核验'],hint: ['Do the images support this caption?','双时相影像支持这句描述吗?'],input: ['T₁ + T₂ + one fixed caption','双图 + 一句固定描述'],output: ['Yes / No','支持 / 不支持'],role: ['Stage 2 verification training','第二阶段事实核验训练'],1 unmodified line},{label: ['Pairwise preference','成对偏好'],hint: ['Does the decision survive an A/B swap?','交换 A/B 后,模型还会选同一句吗?'],input: ['T₁ + T₂ + captions A and B','双图 + A、B 两句描述'],output: ['A / B','选 A 或 B'],role: ['Stage 1 auxiliary training','第一阶段辅助训练'],1 unmodified line},{label: ['Listwise selection','列表选句'],hint: ['The best caption isn’t always first.','最好的描述不一定排在第一。'],input: ['T₁ + T₂ + a caption list','双图 + 一组候选描述'],output: ['One caption from the list','从列表选出一句'],role: ['Stage 1 and Stage 2 inference','两阶段正式推理'],8 unmodified linesexport function probeContent(index, alternate, text) {const task = tasks[index];const choose = text('Selected','选中');const option = (key, label, selected, probability) => `<li class="probe-option${selected ? ' probe-picked' : ''}">${key ? `<code>${key}</code>` : ''}<span${key ? ' lang="en"' : ''}>${label}</span>${selected && probability !== undefined ? `<strong>${choose} · ${probability}%</strong>` : probability !== undefined ? `<small>${probability}%</small>` : ''}${probability !== undefined ? `<meter min="0" max="100" value="${probability}" aria-hidden="true"></meter>` : ''}</li>`;let controls = '';let options;if (index === 0) {options = [option('',text('Changed','有变化'),false,7.6), option('',text('Unchanged','无变化'),true,92.4)];} else if (index === 1) {controls = `<blockquote lang="en">houses are built along the road and some brushwoods disappear</blockquote>` +switches(text('Choose the image evidence','切换影像证据'), text('Supporting pair','支持描述的影像'), text('Conflicting pair','与描述冲突的影像'), alternate);options = [`<li class="probe-option probe-picked${alternate ? ' probe-conflict' : ''}"><span>${alternate ? text('Not supported','不支持') : text('Supported','支持')}</span><strong>P(Yes) ${alternate ? '< 0.1%' : '> 99.9%'}</strong></li>`];} else {controls = switches(text('Choose candidate order','切换选项顺序'), text('Original A/B','原顺序 A/B'), text('Swap A/B','交换 A/B'), alternate);const house = 'houses are built in an open space';const unchanged = 'no change has occurred';options = [option('A',alternate ? unchanged : house,!alternate,alternate ? 8.5 : 96.9), option('B',alternate ? house : unchanged,alternate,alternate ? 91.5 : 3.1)];}return `<h3 class="probe-question">${text(...task.hint)}</h3><p class="explain">${text(...task.explanation)}</p>${protocol(task, text)}${controls}<div class="pool-head">${text('Recorded decision','示例决策记录')}</div><ul class="probe-options" role="list">${options.join('')}</ul>`;}function switches(label, first, second, alternate) {
workbench/index.html+18-15
workbench/lab.css+33-11
workbench/lab.js+83-41
workbench/tasks.js+11-11