Skip to content

Enable web image and video queries as isolated Jobs - #1994

Draft
mattdawkins wants to merge 1 commit into
mainfrom
feature/web-image-video-query
Draft

mattdawkins wants to merge 1 commit into
mainfrom
feature/web-image-video-query

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

Summary

Adds image and video-frame similarity queries to DIVE Web. Users can build reusable private indexes, choose an uploaded image, an uploaded video frame, or a frame from an existing dataset, crop the exemplar, search, and refine results with positive/negative feedback. Results have cropped previews and links to the matching viewer frame. The last query and feedback marks restore after returning from the viewer.

All model execution runs as Jobs on the existing pipeline queue, including indexing, exemplar descriptor extraction, similarity search, and refinement. Private worker queues and the worker's GPU assignment are preserved. Saved SVM model export is deferred.

Execution and isolation

  • Each index build publishes a new private file-backed snapshot. Searches download selected snapshots into a fresh temporary working directory and start their own VIAME query process.
  • No shared PostgreSQL service or persistent GPU process. A query releases its worker between iterations, allowing other users' jobs to run.
  • Refinement replays the original query and feedback against the same snapshots. Feedback is matched by stable result identity, not process-local instance IDs; missing replayed results fail explicitly.
  • Read access to all source datasets is checked at submission, job start, result publication, and result retrieval. Artifact APIs also require the creator. Query jobs do not take dataset annotation locks.
  • Uses existing subprocess log streaming and cancellation. Workers with the old PostgreSQL-only query pipeline fail with an upgrade message.

The browser only decodes media, captures exemplar frames, and renders crops. Client-side ONNX formulation is not introduced because this path preserves the existing descriptor/model contract.

Validation

  • 27 Python tests passed: input validation, archive isolation, source access checks, private job submission, worker compatibility, GPU environment propagation, and feedback replay.
  • 6 frontend tests passed: query restoration, queued refinement, failed-job retry, user isolation, polling cleanup, and dataset picker regressions.
  • TypeScript type check, changed-file ESLint, Python lint/format checks, and production web build passed. Build reports the existing large-chunk/dynamic-import warnings.

Remaining integration validation

Draft pending an end-to-end run with an updated VIAME GPU worker. The local VIAME installation has the older PostgreSQL query pipeline, so GPU inference was not run outside Jobs.

On an updated deployment, build indexes and run image/video-frame searches and multiple refinement rounds while another user runs pipeline jobs. Verify cancellation, result frame alignment, returning from the viewer, and revoked dataset access. Workers need configs/index.py, the file-backed query pipelines, viame.core.query_service, and their descriptor models.

Text queries, saved SVM models, and saving query results as annotations remain desktop-only in this change. Index snapshots and query inputs/results are private Girder artifacts; unused artifacts can be removed through the Data browser. See docs/Query.md for the web workflow and limits.

@BryonLewis

Copy link
Copy Markdown
Collaborator

I'm not sure how well this workflow actuall works on web considering our deployed 2 GPU limit and the fact that those GPU's are almost always being used already. Because they are running long tasks (inference tracking, and training) you may have to wait hours to do your query.

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