Stereo camera-file import/export, display, and length clearing#1710
Open
mattdawkins wants to merge 26 commits into
Open
Stereo camera-file import/export, display, and length clearing#1710mattdawkins wants to merge 26 commits into
mattdawkins wants to merge 26 commits into
Conversation
Add desktop import/export of stereo camera/calibration files via the annotation Import/Export buttons, display the loaded camera file in stereo mode, and clear 'length' attributes from tracks/detections when a new camera file loads (toggle in user settings). On import/upload, any VIAME-supported calibration is converted to the JSON camera format via convert_cam_format.py and stored with the dataset, keeping the original.
(cherry picked from commit 48b84de)
(cherry picked from commit 72e39e2)
Implement a desktop getDatasetCalibration that parses the stored camera-rig JSON, plus cross-platform download/delete, so the checkerboard calibration menu and dialog now function in Electron instead of being web-only. Display the loaded calibration file name in the dialog and tooltip on both desktop and web, and return the file name from the server calibration endpoint. (cherry picked from commit ffaf012)
setDatasetCalibration and exportDatasetCalibration now resolve the parent
dataset id (via datasetId.split('/')[0]) instead of using a per-camera child
id like <parent>/left, which has no multiCam metadata and caused import to
fail.
(cherry picked from commit 5a2279a)
…ngth option, UI tweaks prepareDatasetCalibration now validates JSON content and converts a binary file mislabeled .json (e.g. an .npz copied to last_calibration.json); the last-used backup keeps the source extension. The user's original calibration filename is recorded (calibrationOriginalName) and shown in the menu/dialog. The Import menu gains a 'Reset all length measurements' checkbox that clears length and length_method across all tracks. The calibration button moved to the top toolbar (icon-only, always shown on stereo), reads on dialog open, and the info dialog text was updated. (cherry picked from commit d092737)
Move the reset-length checkbox below the camera-file Import button (matching the annotation-import layout), relabel buttons/sections, stop showing the loaded calibration filename, and drop the JSON-conversion mention. (cherry picked from commit 39aff5c)
ea6e72c to
7b7cd20
Compare
get_calibration no longer 400s/500s for a non-JSON (e.g. .npz) or malformed calibration file; it returns the item id and filename so the viewer shows the calibration as loaded, mirroring desktop's graceful handling.
Add a POST dive_dataset/:id/calibration endpoint and crud_dataset.set_calibration that marks an uploaded file as the dataset's stereo calibration (replacing any prior). Implement web importCalibrationFile (upload to the dataset folder, then mark) and wire it into provideApi, which enables the shared Import Camera File section and the reset-length checkbox on web.
Add a convert_calibration celery task that runs VIAME's convert_cam_format.py on the worker (download item -> convert npz/yml/etc -> upload .json into the same item), so the viewer can display calibration parameters. Enqueued from set_calibration and multicam creation when the uploaded file isn't already JSON; best-effort since stereo pipelines read the original file directly.
The top-level 'platform/web-girder/plugins/girder' import touches window at module load, which broke the node-environment multicamFileRegistry.spec (ReferenceError: window is not defined). Import girderRest lazily inside importCalibrationFile so the module graph stays test-safe.
…y import Annotations area
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.
Stereo Camera File I/O — Branch Feature Summary
Stereo Camera / Calibration File I/O
End-to-end support for stereoscopic calibration (“camera”) files on stereo and multicam datasets, on both web and desktop.
.npz,.json,.cam,.yml,.zip) from the viewer Import menu or during multicam dataset creationconvert_cam_format.py, while keeping the original filecalibrationFile/jsonCalibrationFileitems on web; parallel metadata on desktop).npznamed.json), missing parameters, and files that cannot be fully parsed (filename still reported)Calibration Viewing & Management
New in-viewer calibration UI shared across web and desktop.
Import UX Enhancements
Calibration import is integrated into existing import flows rather than a separate workflow.
Web / Girder Backend
Server-side calibration storage, retrieval, and conversion for web datasets.
GET dive_dataset/calibration— returns calibration metadata and parsed JSON parameters when availablePOST dive_dataset/:id/calibration— associates an uploaded Girder file as the dataset calibrationconvert_calibration) on the pipelines worker queue for non-JSON formatscalibrationFileIdDesktop Backend
Local file-based calibration handling mirroring web behavior.
importCalibrationFile/exportCalibrationFileIPC APIscalibrationConvert.ts)Desktop Export: “Everything” Bundle
Expanded export options for multicam datasets.
multiCam.json, per-camera annotation exports, and the calibration fileDataset Source Info (Desktop)
New dialog for inspecting and opening dataset file locations.
Length Measurement Invalidation
Safety behavior when calibration changes invalidate existing stereo measurements.
clearLengthAttributesutility clearslength(and optionallylength_method) across all camerasclearLengthOnCameraFileLoadstereo setting (default: enabled)Toolbar & UI Polish
Supporting UI work to fit new controls and improve toolbar layout.
OutlinedLabeledGroupandToolbarExpandToggleTypes & API Surface
Shared client/server contracts for calibration data.
CameraCalibration,DatasetStereoCalibration, andDatasetCalibrationResulttypesapispecwith calibration get/import/export/download/delete hooks for both platforms