Skip to content

Write generic keys instead of dive_-prefixed ones - #1866

Open
mattdawkins wants to merge 2 commits into
mainfrom
dev/coco-generic-keys
Open

Write generic keys instead of dive_-prefixed ones#1866
mattdawkins wants to merge 2 commits into
mainfrom
dev/coco-generic-keys

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

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, notes and confidence_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 the dive_-prefixed ones as legacy aliases, so files DIVE wrote earlier keep importing. confidence_pairs gains the same treatment on both readers.

Kept prefixed, because they really are DIVE-specific:

  • info.dive_dataset_info — DIVE's dataset metadata block
  • info.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_notes or dive_confidence_pairs off a DIVE export needs updating; the readers here are covered, third parties are not. info.dive_extensions still 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.md updated, 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_modules in this checkout.

Stacked context: #1865 renames videos[].fps to annotation_fps and is still open. Both touch these files, so whichever lands second will need a trivial rebase.

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.
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