@@ -228,6 +228,9 @@ def video_label_generator(self, timeout_seconds=600, **kwargs):
228
228
Returns:
229
229
LabelGenerator for accessing labels for each video
230
230
"""
231
+ warnings .warn (
232
+ "video_label_generator will be deprecated in a future release. "
233
+ "Use label_generator for video or text/image labels." )
231
234
_check_converter_import ()
232
235
json_data = self .export_labels (download = True ,
233
236
timeout_seconds = timeout_seconds ,
@@ -252,10 +255,12 @@ def video_label_generator(self, timeout_seconds=600, **kwargs):
252
255
253
256
def label_generator (self , timeout_seconds = 600 , ** kwargs ):
254
257
"""
255
- Download text and image annotations
258
+ Download text and image annotations, or video annotations.
259
+
260
+ For a mixture of text/image and video, use project.export_labels()
256
261
257
262
Returns:
258
- LabelGenerator for accessing labels for each text or image
263
+ LabelGenerator for accessing labels
259
264
"""
260
265
_check_converter_import ()
261
266
json_data = self .export_labels (download = True ,
@@ -272,11 +277,14 @@ def label_generator(self, timeout_seconds=600, **kwargs):
272
277
is_video = [
273
278
'frames' in row ['Label' ] for row in json_data if row ['Label' ]
274
279
]
275
- if len (is_video ) and any (is_video ):
280
+
281
+ if len (is_video ) and not all (is_video ) and any (is_video ):
276
282
raise ValueError (
277
- "Found video data rows in export . "
283
+ "Found mixed data types of video and text/image . "
278
284
"Use project.export_labels() to export projects with mixed data types. "
279
- "Or use project.video_label_generator() for video data." )
285
+ )
286
+ if len (is_video ) and all (is_video ):
287
+ return LBV1Converter .deserialize_video (json_data , self .client )
280
288
return LBV1Converter .deserialize (json_data )
281
289
282
290
def export_labels (self ,
0 commit comments