File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
libs/labelbox/src/labelbox/data/serialization/ndjson Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3838from .objects import (
3939 NDObject ,
4040 NDObjectType ,
41+ NDSegments ,
4142 NDVideoMasks ,
4243)
4344from .relationship import NDRelationship
4849 NDPromptClassificationType ,
4950 NDConfusionMatrixMetric ,
5051 NDScalarMetric ,
52+ NDSegments ,
5153 NDVideoMasks ,
5254 NDRelationship ,
5355 NDPromptText ,
@@ -131,7 +133,15 @@ def _generate_annotations(
131133 # deserialized objects in the _AnnotationGroupTuple
132134 # object *if* the object can be used in a relationship
133135 for uuid , ndjson_annotation in group .ndjson_annotations .items ():
134- if isinstance (ndjson_annotation , NDVideoMasks ):
136+ if isinstance (ndjson_annotation , NDSegments ):
137+ annotations .extend (
138+ NDSegments .to_common (
139+ ndjson_annotation ,
140+ ndjson_annotation .name ,
141+ ndjson_annotation .schema_id ,
142+ )
143+ )
144+ elif isinstance (ndjson_annotation , NDVideoMasks ):
135145 annotations .append (
136146 NDVideoMasks .to_common (ndjson_annotation )
137147 )
Original file line number Diff line number Diff line change @@ -724,6 +724,8 @@ def lookup_object(
724724 ) -> "NDObjectType" :
725725 if isinstance (annotation , VideoMaskAnnotation ):
726726 result = NDVideoMasks
727+ elif isinstance (annotation , list ):
728+ result = NDSegments
727729 else :
728730 result = {
729731 Line : NDLine ,
You can’t perform that action at this time.
0 commit comments