Generating the middle frames of a video with TensorFlow Hub
Another interesting application of deep learning to videos involves frame generation. A fun and practical example of this technique is slow motion, where a network decides, based on the context, how to create intervening frames, thus expanding the length of a video and creating the illusion it was recorded with a high-speed camera (if you want to read more about it, refer to the See also… section).
In this recipe, we'll use a 3D convolutional network to produce the middle frames of a video, given only its first and last frames.
For this purpose, we'll rely on TFHub.
Let's start this recipe.
Getting ready
We must install TFHub and TensorFlow Datasets
:
$> pip install tensorflow-hub tensorflow-datasets
The model we'll use was trained on the BAIR Robot Pushing Videos
dataset, which is available in TensorFlow Datasets
. However, if we access it through the library, we'll...