Skip to content

Commit 305ed67

Browse files
committed
fixed
1 parent af7b474 commit 305ed67

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

libs/labelbox/src/labelbox/data/annotation_types/base_annotation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ class BaseAnnotation(FeatureSchema, abc.ABC):
1616

1717
def __init__(self, **data):
1818
super().__init__(**data)
19-
extra_uuid = data.get("extra", {}).get("uuid")
20-
self._uuid = data.get("_uuid") or extra_uuid or uuid4()
19+
self._uuid = data.get("_uuid") or uuid4()

libs/labelbox/tests/data/annotation_import/test_mea_prediction_import.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ def test_create_from_label_objects(
218218
annotations=[
219219
ObjectAnnotation(
220220
name="polygon",
221+
extra={
222+
"uuid": "6d10fa30-3ea0-4e6c-bbb1-63f5c29fe3e4",
223+
},
221224
value=Polygon(
222225
points=[
223226
Point(x=147.692, y=118.154),
@@ -230,13 +233,19 @@ def test_create_from_label_objects(
230233
),
231234
ObjectAnnotation(
232235
name="bbox",
236+
extra={
237+
"uuid": "15b7138f-4bbc-42c5-ae79-45d87b0a3b2a",
238+
},
233239
value=Rectangle(
234240
start=Point(x=58.0, y=48.0),
235241
end=Point(x=70.0, y=113.0),
236242
),
237243
),
238244
ObjectAnnotation(
239245
name="polyline",
246+
extra={
247+
"uuid": "cf4c6df9-c39c-4fbc-9541-470f6622978a",
248+
},
240249
value=Line(
241250
points=[
242251
Point(x=147.692, y=118.154),

0 commit comments

Comments
 (0)