Skip to content

Commit 8f74ade

Browse files
Drew KaulDrew Kaul
authored andcommitted
fixes to CuboidAnnotation class
1 parent dffe0db commit 8f74ade

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nucleus/annotation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def from_json(cls, payload: dict):
289289
dimensions=Point3D.from_json(geometry.get(DIMENSIONS_KEY, {})),
290290
yaw=payload.get(YAW_KEY, 0),
291291
reference_id=payload.get(REFERENCE_ID_KEY, None),
292-
item_id=payload.get(DATASET_ITEM_ID_KEY, None),
292+
item_id=payload.get(ITEM_ID_KEY, None),
293293
annotation_id=payload.get(ANNOTATION_ID_KEY, None),
294294
metadata=payload.get(METADATA_KEY, {}),
295295
)
@@ -299,11 +299,12 @@ def to_payload(self) -> dict:
299299
LABEL_KEY: self.label,
300300
TYPE_KEY: CUBOID_TYPE,
301301
GEOMETRY_KEY: {
302-
POSITION_KEY: self.position,
303-
DIMENSIONS_KEY: self.dimensions,
302+
POSITION_KEY: self.position.to_payload(),
303+
DIMENSIONS_KEY: self.dimensions.to_payload(),
304304
YAW_KEY: self.yaw,
305305
},
306306
REFERENCE_ID_KEY: self.reference_id,
307+
ITEM_ID_KEY: self.item_id,
307308
ANNOTATION_ID_KEY: self.annotation_id,
308309
METADATA_KEY: self.metadata,
309310
}

0 commit comments

Comments
 (0)