From dd6c6b5d8f84009ade229b6243d4a207a95db73b Mon Sep 17 00:00:00 2001 From: ingalls Date: Wed, 10 Jan 2024 21:37:14 -0800 Subject: [PATCH] Add Label ID --- src/api/db/models/Image.js | 4 ++++ src/api/type-defs/objects/Label.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/db/models/Image.js b/src/api/db/models/Image.js index 86c875d8..5e5dfdc5 100644 --- a/src/api/db/models/Image.js +++ b/src/api/db/models/Image.js @@ -476,6 +476,8 @@ export class ImageModel { return await retry(async () => { console.log('ImageModel.createInternalLabels - creating label: ', JSON.stringify(label)); + label.type = 'ml'; + // find image, create label record const image = await ImageModel.queryById(label.imageId, context); if (isLabelDupe(image, label)) throw new DuplicateLabelError(); @@ -545,6 +547,8 @@ export class ImageModel { return await retry(async () => { console.log('ImageModel.createLabels - creating label: ', JSON.stringify(label)); + label.type = 'manual'; + // find image, create label record const image = await ImageModel.queryById(label.imageId, context); const project = await ProjectModel.queryById(image.projectId); diff --git a/src/api/type-defs/objects/Label.js b/src/api/type-defs/objects/Label.js index 888bea18..4dfe6155 100644 --- a/src/api/type-defs/objects/Label.js +++ b/src/api/type-defs/objects/Label.js @@ -8,7 +8,7 @@ export default ` type Label { _id: ID! type: String! - category: String! + labelId: String! conf: Float bbox: [Float!]! labeledDate: Date!