fix(adr-116): surface WiFlow-v1 in Model Control dropdown

LiveDemoTab.fetchModels() now probes /api/v1/info after the RVF
model list; when features.pose_estimation is true (i.e.
--wiflow-model was loaded), inserts a virtual 'WiFlow-v1 (lite,
186K params, --wiflow-model)' option, marks it active, and
populates name + PCK 0.929 in the panel.

Cosmetic only — does not change inference path or pose_keypoints
flow. Closes the UX inconsistency where the badge said MODEL
INFERENCE but the dropdown said 'No model loaded'.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
arsen 2026-05-17 18:56:53 +07:00
parent 7cdd8f69e6
commit 0ec1e4b06f
1 changed files with 30 additions and 0 deletions

View File

@ -1515,6 +1515,36 @@ export class LiveDemoTab {
} catch (error) {
this.logger.warn('Could not fetch models', { error: error.message });
}
// ADR-116: surface WiFlow-v1 in the Model Control dropdown when the
// server reports `pose_estimation: true` via /api/v1/info. WiFlow is
// loaded outside the RVF model registry path (--wiflow-model flag),
// so listModels() above doesn't return it. This adds a virtual entry
// marked as already active.
try {
const r = await fetch('/api/v1/info');
if (r.ok) {
const info = await r.json();
if (info?.features?.pose_estimation) {
if (!this.modelState.models.some(m => m.id === 'wiflow-v1')) {
this.modelState.models.unshift({
id: 'wiflow-v1',
name: 'WiFlow-v1 (lite, 186K params, --wiflow-model)',
});
}
this.modelState.activeModelId = 'wiflow-v1';
this.modelState.activeModelInfo = {
model_id: 'wiflow-v1',
name: 'WiFlow-v1',
version: 'lite',
pck_score: 0.929, // from model card; eval-set, not this deployment
};
this.populateModelSelector();
this.updateModelUI();
}
}
} catch (e) {
this.logger.warn('ADR-116 info probe failed', { error: e.message });
}
}
populateModelSelector() {