Skip to content

Server-side interactive segmentation and stereo for the web client - #1982

Draft
mattdawkins wants to merge 1 commit into
mainfrom
dev/server-interactive
Draft

mattdawkins wants to merge 1 commit into
mainfrom
dev/server-interactive

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

Draft. Runs the web client's interactive SAM segmentation and stereo point mapping in VIAME's interactive_service on the server GPU instead of ONNX in the browser (the alternative to #1672 discussed earlier).

Server

  • dive_interactive broker (new compose service interactive, GPU profile, same worker image): spawns one viame.core.interactive_service process per user+dataset session, matches its out-of-order replies by id, keeps disparity_ready events for polling
  • Load limits so many segmentation / mapping requests cannot crowd the GPU: DIVE_INTERACTIVE_MAX_SESSIONS resident processes (idlest evicted), DIVE_INTERACTIVE_IDLE_SECONDS retirement, DIVE_INTERACTIVE_MAX_INFLIGHT inferences at once, and a request that cannot get a turn within DIVE_INTERACTIVE_QUEUE_TIMEOUT is refused with 503 rather than queued
  • Girder dive_interactive resource: segmentation/predict, segmentation/keypoints, segmentation/stereo_segment, text_query, stereo/{set_frame,transfer_points,transfer_line,measure_line,aggregate_lengths}, DELETE session. Resolves dataset/camera/frame to assetstore paths (image sequences and transcoded video with frame time; large-image datasets rejected) and the calibration item; the interactive container mounts the assetstore read-only
  • Gating: the tools are paused (503 and interactiveEnabled: false in dive_configuration) while any pipelines / training / private-queue job is queued or running, since they share the GPU
  • Tests: session manager against a fake service process (deferred replies, events, busy refusal, eviction, reaping, crash recovery) and the gate

Client (web)

  • useServerSegmentation: hooks the shared point-segmentation recipe to the server (Segment tool now works on web) and carries a finished mask to the other stereo camera via the service's stereo_segment
  • StereoServerMatcher: every stereo method (ncc, dino, foundation) runs through the server while it is up; the browser ONNX matchers remain the fallback. dino becomes selectable on web when the server offers it
  • useConfig gains the interactive capability and re-checks it when a viewer opens

Not yet done / to discuss

  • Text query and refine are exposed server-side but not wired into the web UI
  • Auto-populate of new boxes/lines on web (as Add SAM2/SAM3 browser segmentation and stereo auto-population #1672 does client-side) is not wired
  • Not run against a real GPU deployment yet; the worker image needs verifying that viame.core.interactive_service and the SAM / stereo add-on configs resolve under /tmp/addons/extracted
  • Frame pixels are still fetched by the browser before a server warp (harmless, wasteful)

🤖 Generated with Claude Code

A broker on the GPU host keeps VIAME interactive_service processes
resident, capped in number, retired when idle, one inference at a time,
refusing requests that cannot get a turn quickly. Girder resolves
dataset frames and calibration to assetstore paths, pauses the tools
while pipeline or training jobs hold the GPU, and forwards commands.
The web client hooks the shared point-segmentation recipe to it, carries
masks across cameras with the service, and runs every stereo matching
method through it while it is up, falling back to the browser models.
@BryonLewis

Copy link
Copy Markdown
Collaborator

With #1672 merged, DIVE Web already has point-prompt SAM segmentation and stereo auto-population running in the browser (ONNX / WebGPU with WASM fallback). That covers the interactive web workflow this PR was standing in for.

I don’t think we need the server-side interactive broker / Girder proxy path anymore for that purpose, it adds GPU-host ops, long-lived sync request handling, and session management we can avoid now that the client path is in main.

Happy to close this as superseded by #1672 unless there’s a separate reason to keep a VIAME-parity / server-GPU option (shared GPU with pipelines, weak clients, exact desktop service parity, etc.). If so, we can reopen or split that out later; otherwise I’ll close this draft.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants