Skip to content

Commit 8a753d1

Browse files
author
The TensorFlow Datasets Authors
committed
Fix documentation for the Video feature.
PiperOrigin-RevId: 788915522
1 parent fbeaf63 commit 8a753d1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tensorflow_datasets/core/features/video_feature.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,15 @@ def __init__(
129129
frame_shape = shape[1:]
130130
self._encoding_format = encoding_format
131131
self._extra_ffmpeg_args = list(ffmpeg_extra_args or [])
132-
super(Video, self).__init__(
132+
super().__init__(
133133
image_feature.Image(
134134
shape=frame_shape,
135135
dtype=dtype,
136136
encoding_format=encoding_format,
137137
use_colormap=use_colormap,
138138
),
139139
length=shape[0] if shape else None,
140+
doc=doc,
140141
)
141142

142143
def _ffmpeg_decode(self, path_or_fobj):

tensorflow_datasets/core/features/video_feature_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from tensorflow_datasets.core import features
2727

2828

29+
2930
class VideoFeatureTest(testing.FeatureExpectationsTestCase):
3031

3132
@property
@@ -34,9 +35,10 @@ def _test_data_path(self):
3435

3536
def test_video_numpy(self):
3637
np_video = np.random.randint(256, size=(128, 64, 64, 3), dtype=np.uint8)
37-
38+
doc = 'This is a test video.'
39+
feature = features.Video(shape=(None, 64, 64, 3), doc=doc)
3840
self.assertFeature(
39-
feature=features.Video(shape=(None, 64, 64, 3)),
41+
feature=feature,
4042
shape=(None, 64, 64, 3),
4143
dtype=tf.uint8,
4244
tests=[
@@ -135,5 +137,6 @@ def read(self, *args, **kwargs):
135137
],
136138
)
137139

140+
138141
if __name__ == '__main__':
139142
testing.test_main()

0 commit comments

Comments
 (0)