From d9e166ceff7093e2f1c460df64e808a1c222e51b Mon Sep 17 00:00:00 2001 From: Bryon Lewis Date: Thu, 23 May 2024 13:24:34 -0400 Subject: [PATCH 1/3] adjust frame for CSV matching --- server/dive_utils/serializers/viame.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/dive_utils/serializers/viame.py b/server/dive_utils/serializers/viame.py index b3c358daf..d9f42d544 100644 --- a/server/dive_utils/serializers/viame.py +++ b/server/dive_utils/serializers/viame.py @@ -355,6 +355,10 @@ def load_csv_as_tracks_and_attributes( maxFrame = float('-inf') frameMapper = {} filteredImages = [item for item in foundImages if item['frame'] != -1] + print('FilteredImages') + print(filteredImages) + print('FoundIamges') + print(foundImages) for index, item in enumerate(filteredImages): if item['frame'] == -1: continue @@ -374,7 +378,7 @@ def load_csv_as_tracks_and_attributes( f'item difference: {item_difference}' ) ) - frameMapper[item['csvFrame']] = index + frameMapper[item['csvFrame']] = item['frame'] minFrame = min(minFrame, item['csvFrame']) maxFrame = max(maxFrame, item['csvFrame']) From f611ce58c03663f1f2955675b6e11ed75637fdf9 Mon Sep 17 00:00:00 2001 From: Bryon Lewis Date: Thu, 23 May 2024 15:42:54 -0400 Subject: [PATCH 2/3] add frame filename matching --- client/dive-common/apispec.ts | 2 +- .../components/ImportAnnotations.vue | 15 +++++++++-- client/platform/desktop/backend/cli.ts | 2 +- client/platform/desktop/backend/ipcService.ts | 3 +++ .../platform/desktop/backend/native/common.ts | 23 +++++++++------- .../desktop/backend/serializers/viame.spec.ts | 6 ++--- .../desktop/backend/serializers/viame.ts | 27 ++++++++++++------- client/platform/desktop/frontend/api.ts | 2 +- .../web-girder/api/dataset.service.ts | 7 ++++- client/platform/web-girder/api/rpc.service.ts | 3 ++- client/platform/web-girder/views/Export.vue | 9 ++++--- server/dive_server/crud_rpc.py | 19 +++++++------ server/dive_utils/serializers/viame.py | 20 +++++++------- 13 files changed, 87 insertions(+), 51 deletions(-) diff --git a/client/dive-common/apispec.ts b/client/dive-common/apispec.ts index f32f7180a..a9f697bbf 100644 --- a/client/dive-common/apispec.ts +++ b/client/dive-common/apispec.ts @@ -168,7 +168,7 @@ interface Api { getTileURL?(itemId: string, x: number, y: number, level: number, query: Record): string; importAnnotationFile(id: string, path: string, file?: File, - additive?: boolean, additivePrepend?: string, set?: string): Promise; + additive?: boolean, additivePrepend?: string, set?: string): Promise; } const ApiSymbol = Symbol('api'); diff --git a/client/dive-common/components/ImportAnnotations.vue b/client/dive-common/components/ImportAnnotations.vue index 95870bc11..b5a38b612 100644 --- a/client/dive-common/components/ImportAnnotations.vue +++ b/client/dive-common/components/ImportAnnotations.vue @@ -52,7 +52,7 @@ export default defineComponent({ if (!ret.canceled) { menuOpen.value = false; const path = ret.filePaths[0]; - let importFile = false; + let importFile: boolean | string[] = false; processing.value = true; const set = currentSet.value === 'default' ? undefined : currentSet.value; if (ret.fileList?.length) { @@ -74,6 +74,17 @@ export default defineComponent({ set, ); } + console.log(importFile); + if (Array.isArray(importFile) && importFile.length) { + const text = ['There were warnings when importing. While the data imported properly please double check your annotations', + 'Below is a list of information that can help with debugging', + ].concat(importFile as string[]); + await prompt({ + title: 'Import Warnings', + text, + positiveButton: 'OK', + }); + } if (importFile) { processing.value = false; @@ -188,7 +199,7 @@ export default defineComponent({ outlined small > -