@@ -228,6 +228,9 @@ def video_label_generator(self, timeout_seconds=600, **kwargs):
228228 Returns:
229229 LabelGenerator for accessing labels for each video
230230 """
231+ warnings .warn (
232+ "video_label_generator will be deprecated in a future release. "
233+ "Use label_generator for video or text/image labels." )
231234 _check_converter_import ()
232235 json_data = self .export_labels (download = True ,
233236 timeout_seconds = timeout_seconds ,
@@ -252,10 +255,12 @@ def video_label_generator(self, timeout_seconds=600, **kwargs):
252255
253256 def label_generator (self , timeout_seconds = 600 , ** kwargs ):
254257 """
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()
256261
257262 Returns:
258- LabelGenerator for accessing labels for each text or image
263+ LabelGenerator for accessing labels
259264 """
260265 _check_converter_import ()
261266 json_data = self .export_labels (download = True ,
@@ -272,11 +277,14 @@ def label_generator(self, timeout_seconds=600, **kwargs):
272277 is_video = [
273278 'frames' in row ['Label' ] for row in json_data if row ['Label' ]
274279 ]
275- if len (is_video ) and any (is_video ):
280+
281+ if len (is_video ) and not all (is_video ) and any (is_video ):
276282 raise ValueError (
277- "Found video data rows in export . "
283+ "Found mixed data types of video and text/image . "
278284 "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 )
280288 return LBV1Converter .deserialize (json_data )
281289
282290 def export_labels (self ,
0 commit comments