Write generic keys instead of dive_-prefixed ones - #1866
Open
mattdawkins wants to merge 2 commits into
Open
Conversation
Attributes, notes and confidence pairs are not DIVE concepts, so export writes attributes, track_attributes, notes and confidence_pairs. Import still reads the prefixed spellings, so older files keep working.
The repo's eslint config disallows for...of.
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.
Per-detection attributes, track attributes, notes and confidence pairs are generic annotation concepts — nothing about them is specific to DIVE — so export should not brand them. Export now writes
attributes,track_attributes,notesandconfidence_pairs.Import already fell back to the unprefixed names for attributes and notes (
kwcoco.py:345,349,coco.ts:452,462,466); this makes those the preferred spelling and keeps thedive_-prefixed ones as legacy aliases, so files DIVE wrote earlier keep importing.confidence_pairsgains the same treatment on both readers.Kept prefixed, because they really are DIVE-specific:
info.dive_dataset_info— DIVE's dataset metadata blockinfo.dive_extensions— DIVE describing which optional keys it used (its contents are now the generic names)This changes DIVE's output format. Anything downstream reading
dive_detection_attributes,dive_track_attributes,dive_notesordive_confidence_pairsoff a DIVE export needs updating; the readers here are covered, third parties are not.info.dive_extensionsstill advertises which keys a given file uses.Tests: export assertions moved to the generic keys; existing prefixed documents were left as-is so they now serve as legacy-import coverage, and both suites gained an explicit generic-vs-prefixed pair.
docs/DataFormats.mdupdated, including the worked example and the legacy-alias notes.Verified: 44 server tests pass locally, and a real export/import round trip writes
['attributes', 'confidence_pairs', 'notes', 'prob', 'track_attributes']and reads every value back.Not run: vitest, eslint and tsc — no
node_modulesin this checkout.Stacked context: #1865 renames
videos[].fpstoannotation_fpsand is still open. Both touch these files, so whichever lands second will need a trivial rebase.