Skip to content

Optional per-dataset metadata file passed to opt-in pipelines#1764

Open
mattdawkins wants to merge 4 commits into
mainfrom
dev/optional-metadata-file
Open

Optional per-dataset metadata file passed to opt-in pipelines#1764
mattdawkins wants to merge 4 commits into
mainfrom
dev/optional-metadata-file

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

Summary

Adds an optional metadata file (.json / .txt / .csv) to single-image and multi-camera image-sequence imports, mirroring how calibration files are optionally attached to stereo datasets — but without the stereo gating. DIVE keeps a link to the file per dataset and hands it to pipelines that opt in.

Built for the sea-lion add-on, whose registration pipelines consume it as -s stabilizer:flight_log=<path>.

How it works

A pipe opts in with a header directive:

# Metadata File: stabilizer:flight_log

Both pipe-metadata readers (server pipeline_discovery.extract_pipe_metadata and desktop extractPipeMetadata) parse this into PipeMetadata.metadataFileKey. At run time DIVE appends -s <key>="<path>" only for pipes that declare the header, so all other pipelines are unaffected.

Changes

Contract / parsing

  • # Metadata File: <block>:<key>metadataFileKey (server + desktop + shared types); added to the description-block stop conditions.

Desktop

  • "Metadata File (Optional)" picker in the single-import dialog and a new non-stereo-gated ImportMultiCamMetadata picker in the multicam dialog.
  • File copied into the project dir at import (JsonMeta.metadataFile / metadataOriginalName); viame.ts injects -s <key>="<path>" for opt-in pipes (single + multicam).

Web + server

  • File uploaded as a marked Girder item; folder-level metadataFileItemId marker (via create_multicam metadataFileId for multicam, and a new POST dive_dataset/:id/metadata_file endpoint for single).
  • crud_rpc.run_pipeline resolves the item for opt-in pipes; the run task downloads it and appends the override for single and multicam alike.

Testing

  • vite build (web) and electron-vite build (desktop) both succeed.
  • eslint clean on dive-common/ and platform/.
  • Server modules py_compile clean; pipe-header parser verified against the sea-lion pipes.
  • No new unit-test regressions (pre-existing File is not defined env failures are unaffected).

🤖 Generated with Claude Code

mattdawkins and others added 4 commits July 17, 2026 12:17
…elines

Add an optional metadata file (.json/.txt/.csv) to single-image and
multi-camera image-sequence imports, mirroring how calibration files are
optionally attached to stereo datasets — but without the stereo gating.
DIVE stores a link to the file per dataset and hands it to pipelines that
opt in via a new `# Metadata File: <block>:<key>` pipe header. Built for
the sea-lion add-on, whose registration pipelines read it as
`-s stabilizer:flight_log=<path>`.

Pipe header / contract:
- Parse `# Metadata File: <kwiver-key>` in both pipe-metadata readers
  (server pipeline_discovery.extract_pipe_metadata, desktop
  extractPipeMetadata) into PipeMetadata.metadataFileKey. Pipes that do
  not declare it receive nothing, so other pipelines are unaffected.

Desktop:
- Import dialog "Metadata File (Optional)" picker (single) and a
  non-stereo-gated ImportMultiCamMetadata picker (multicam).
- Store the file in the project dir at import (JsonMeta.metadataFile /
  metadataOriginalName) and inject `-s <key>="<path>"` in viame.ts for
  pipes that opt in.

Web + server:
- Upload the file as a marked Girder item and record a folder-level
  metadataFileItemId marker (create_multicam metadataFileId for multicam;
  a new POST dive_dataset/:id/metadata_file endpoint for single).
- crud_rpc.run_pipeline resolves the item for opt-in pipes; the run task
  downloads it and appends the `-s <key>=<path>` override for single and
  multicam alike.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sea-lion registration reads the frame list from the stabilizer's own
image_list / frame_list params, not just the input reader's video_filename,
so DIVE must pass the list in two places. Add two opt-in pipe headers:

  # Image List Keys: stabilizer:image_list   (primary / first-camera manifest)
  # Frame List Keys: stabilizer:frame_list   (comma-joined per-camera manifests)

Both pipe-metadata readers parse them into PipeMetadata.imageListKeys /
frameListKeys. At run time DIVE binds the same absolute manifest path(s) it
feeds input:video_filename to each declared key — for single-image and
multicam runs, on desktop (viame.ts) and web/server (tasks.py). Pipes that do
not declare the headers are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eys)

Collapse the two image-list headers into one. `# Image List Keys:` now binds
the run's input image list(s) to every listed key with the same value — one
list per camera (single-camera: the one manifest; multicam: the per-camera
manifests comma-joined). Removes the separate primary/first-camera vs
comma-joined distinction and the `# Frame List Keys:` header, so a pipe simply
points image_list and frame_list at the same input lists DIVE already writes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Image-list keys are now per-camera pointers to a single line-separated file, not
a comma-separated list. `# Image List Keys:` templates may contain a `{cam}`
placeholder, which DIVE expands to the 1-based camera index — e.g.
`stabilizer:image_list{cam}` becomes `-s stabilizer:image_list1=<cam1 list>
-s stabilizer:image_list2=<cam2 list> ...`. A key without `{cam}` gets the first
camera's list. Single-image runs bind one list (image_list1). Matches the
colmap_registration process, which now takes one image_list<i> per camera.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant