Skip to content

Commit c48a0e6

Browse files
author
Val Brodsky
committed
Fix logic for deriving data types for annotations
1 parent 20949f4 commit c48a0e6

File tree

1 file changed

+4
-1
lines changed
  • libs/labelbox/src/labelbox/data/serialization/ndjson

1 file changed

+4
-1
lines changed

libs/labelbox/src/labelbox/data/serialization/ndjson/label.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,11 @@ def _infer_media_type(
156156
raise ValueError("Missing annotations while inferring media type")
157157

158158
types = {type(annotation) for annotation in annotations}
159+
types_values = {type(annotation.value) for annotation in annotations}
159160
data = ImageData
160-
if (TextEntity in types) or (ConversationEntity in types):
161+
if (ObjectAnnotation
162+
in types) and ((TextEntity in types_values) or
163+
(ConversationEntity in types_values)):
161164
data = TextData
162165
elif VideoClassificationAnnotation in types or VideoObjectAnnotation in types:
163166
data = VideoData

0 commit comments

Comments
 (0)