tfds.features.Video Использование видео для декодирования видео в тензорном потоке 2 - PullRequest
0 голосов
/ 05 марта 2020

Я пытаюсь декодировать видео в тензорном потоке 2, используя tfds.features.Video, так что на выходе получается «tf.Tensor типа tf.uint8 и shape [num_frames, height, width, channel]]», используя следующий код :

import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow_datasets as tfds
df_trains= pd.DataFrame()
df_trains['video_files']= ['aa.mp4']

files_ds = tf.data.Dataset.from_tensor_slices(df_trains.video_files)

video_class = tfds.features.Video(shape=(None, 1080, 1920,3), encoding_format='png', ffmpeg_extra_args=())

a= video_class.decode_example(files_ds)

Однако выдается следующая ошибка: "AssertionError: Feature Video can only be decoded when defined as top-level feature, through info.features.decode_example()"

Я не могу ее решить, пожалуйста, помогите в этом отношении.

...