Fix #1052 import json and meta json#1053
Conversation
BryonLewis
left a comment
There was a problem hiding this comment.
This cleans up quite a bit of stuff.
One change noted is there was previously a guard to only allow NIST import on video files. This was done because the core NIST format relies specifically on named video files and frame numbers. I don't think this needs to be added back in.
The important issue is the possible clobbering of the project meta.json file by doing a merge with a full export meta.json from the server. If you export the configuration file and use it that works perfectly. If you do a full zip export and use the meta.json that is where there are possible failures.
| const data = await nistSerializers.loadNistFile(path); | ||
| tracks = data.tracks; | ||
| meta.fps = data.fps; | ||
| } else if (DatasetMetaMutableKeys.some((key) => key in jsonObject)) { |
There was a problem hiding this comment.
We need to restrict to only the DatasetMetaMutableKeys. If you do a full export from the server you get a meta.json file. If you import that file it passes this check but then merges with the existing meta structure causing the file to have a bunch of extra fields which may be incorrect if there is any overlap (like fps and type fields). This could also occur if a user tries to import their meta.json desktop file from another or similar dataset. It will do the merge and completely break the data then.
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const console = new Console(process.stdout, process.stderr); | ||
|
|
||
| const emptyCsvString = '# comment line\n# metadata,fps: 32,"whateever"\n#comment line'; |
There was a problem hiding this comment.
very minor can ignore because it is in a test. whateever -> whatever
Changes
Notes
annotationImportwithdataFileImportagnostic to the kind of data being ingested to match web logicTesting
Tested with json tracks, meta files, and CSV. I don't have any NIST data, but if you tell me where to find some, I can check that too.
fixes #1052