Skip to content

Commit 4f3fc35

Browse files
author
Matt Sokoloff
committed
fixed video export bug
1 parent 2139b1d commit 4f3fc35

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .labelbox_v1 import LBV1Converter

labelbox/data/serialization/labelbox_v1/converter.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ def deserialize_video(json_data: Iterable[Dict[str, Any]], client):
1818
"""
1919
This method is only necessary if the json payload for the data contains links to the video data.
2020
"""
21-
label_generator = (LBV1Label(**example).to_common(is_video=True)
21+
label_generator = (LBV1Label(**example).to_common()
2222
for example in VideoIterator(json_data, client))
2323
return LabelCollection(data=label_generator)
2424

2525
@staticmethod
2626
def deserialize(json_data: Iterable[Dict[str, Any]]) -> LabelCollection:
27-
label_generator = (
28-
LBV1Label(**example).to_common() for example in json_data)
29-
return LabelCollection(data=label_generator)
27+
def label_generator():
28+
for example in json_data:
29+
if 'frames' in example['Label']:
30+
raise ValueError("Use `LBV1Converter.deserialize_video` to process video")
31+
yield LBV1Label(**example).to_common()
32+
return LabelCollection(data=label_generator())
3033

3134
@staticmethod
3235
def serialize(label_collection: LabelCollection,

labelbox/data/serialization/labelbox_v1/feature.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ def dict(self, *args, **kwargs):
2424

2525
class Config:
2626
allow_population_by_field_name = True
27+

0 commit comments

Comments
 (0)