Client-side stereo detection transfer via ONNX (first pass)#1709
Open
mattdawkins wants to merge 1 commit into
Open
Client-side stereo detection transfer via ONNX (first pass)#1709mattdawkins wants to merge 1 commit into
mattdawkins wants to merge 1 commit into
Conversation
eb3573d to
42ca8d8
Compare
Runs VIAME's epipolar template-matching model (stereo method 1) in the browser with onnxruntime-web to warp a detection (box / head-tail keypoints) from one camera to the other, with no backend. Includes calibration (.npz/.json) and grayscale helpers, a platform-agnostic transfer composable, and web ViewerLoader wiring. Core is validated against the VIAME reference in unit tests.
42ca8d8 to
a55690f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First pass at warping a detection from one camera to the other entirely
client-side (web + Electron renderer), with no backend, by running VIAME's
epipolar template-matching stereo model (stereo measurement "method 1")
exported to ONNX and executed with onnxruntime-web.
This is the client counterpart to the desktop backend stereo service: the
desktop ViewerLoader warps via native IPC (
stereoTransferLine/stereoTransferPoints); this does the equivalent correspondence search in thebrowser so it also works on the web.
What's here (
client/dive-common/use/stereo/)StereoOnnxMatcher— loads thematchONNX model and warps source points totarget points (epipolar candidate generation + NCC along the curve).
calibration.ts/npz.ts— parse.npz/.jsoncalibration in-browser(mirrors
read_stereo_rig), plusinvertRigto swap source/target camera.image.ts— RGBA to BT.601 grayscale (matches OpenCV BGR2GRAY used by the NCC).frameSource.ts— read full-res frame pixels from a GeoJS viewer.useStereoOnnxTransfer— onstereo-annotation-complete, warp a box (corners)or head/tail line (keypoints) to the other camera and write the feature.
platform/web-girder/useStereoOnnxWeb.ts, bound to the Viewer'sstereo-annotation-completeevent in the webViewerLoader.vue.onnxruntime-webis added as a dependency. The exported model is served as astatic asset (default
/models/stereo_match.onnx).Testing
__tests__/stereoOnnx.spec.ts, runs undernpm test):calibration parsing, grayscale, and point warping validated against the VIAME
C++/Python reference (matches to ~0.25 px) via onnxruntime-web in Node.
type-checked and lint-clean but has not been live-tested in a running web
viewer with a real stereo dataset.
Notes
setting.