Skip to content

Commit 09b5d45

Browse files
committed
remove only necessary fields
1 parent 99f6ff4 commit 09b5d45

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

labelbox/data/serialization/ndjson/converter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ def serialize(
3939
A generator for accessing the ndjson representation of the data
4040
"""
4141
for example in NDLabel.from_common(labels):
42-
yield example.dict(by_alias=True, exclude_none=True)
42+
res = example.dict(by_alias=True)
43+
if res.schema_id is None:
44+
res.pop('schema_id')
45+
if res.name is None:
46+
res.pop('name')
47+
yield res

labelbox/data/serialization/ndjson/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _create_video_annotations(
9595
if isinstance(
9696
annot,
9797
(VideoClassificationAnnotation, VideoObjectAnnotation)):
98-
video_annotations[annot.name or annot.schema_id].append(annot)
98+
video_annotations[annot.schema_id or annot.name].append(annot)
9999

100100
for annotation_group in video_annotations.values():
101101
consecutive_frames = cls._get_consecutive_frames(

0 commit comments

Comments
 (0)