From 34cc7e14d4bb1e3c6a3857ceead6f5a13a5cc27b Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 8 Jul 2022 14:40:35 +0900 Subject: [PATCH] Add label field to exported dataset --- backend/data_export/models.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/data_export/models.py b/backend/data_export/models.py index 0e5703eb..6c38ea92 100644 --- a/backend/data_export/models.py +++ b/backend/data_export/models.py @@ -83,7 +83,14 @@ class ExportedText(TextLabel): class ExportedBoundingBox(BoundingBox): def to_dict(self): - return {"uuid": str(self.uuid), "x": self.x, "y": self.y, "width": self.width, "height": self.height} + return { + "uuid": str(self.uuid), + "x": self.x, + "y": self.y, + "width": self.width, + "height": self.height, + "label": self.label.text, + } def to_tuple(self): return self.x, self.y, self.width, self.height @@ -94,7 +101,7 @@ class ExportedBoundingBox(BoundingBox): class ExportedSegmentation(Segmentation): def to_dict(self): - return {"uuid": str(self.uuid), "points": self.points} + return {"uuid": str(self.uuid), "points": self.points, "label": self.label.text} class Meta: proxy = True