{ "cells": [ { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "view-in-github" }, "source": [ "\"Open" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "FypCcZkNNt2p" }, "outputs": [], "source": [ "!git clone https://github.com/hzwer/arXiv2020-RIFE" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "1wysVHxoN54f" }, "outputs": [], "source": [ "!mkdir /content/arXiv2020-RIFE/train_log\n", "%cd /content/arXiv2020-RIFE/train_log\n", "!gdown --id 1APIzVeI-4ZZCEuIRE1m6WYfSCaOsi_7_\n", "!7z e RIFE_trained_model_v3.6.zip" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "AhbHfRBJRAUt" }, "outputs": [], "source": [ "%cd /content/arXiv2020-RIFE/\n", "!gdown --id 1i3xlKb7ax7Y70khcTcuePi6E7crO_dFc\n", "!pip install scikit-video" ] }, { "cell_type": "markdown", "metadata": { "id": "rirngW5uRMdg" }, "source": [ "Please upload your video to content/arXiv2020-RIFE/video.mp4, or use our demo video." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "dnLn4aHHPzN3" }, "outputs": [], "source": [ "!nvidia-smi\n", "!python3 inference_video.py --exp=2 --video=demo.mp4 --montage" ] }, { "cell_type": "markdown", "metadata": { "id": "77KK6lxHgJhf" }, "source": [ "Our demo.mp4 is 25FPS. You can adjust the parameters for your own perference.\n", "For example: \n", "--fps=60 --exp=1 --video=mydemo.avi --png" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "code", "id": "0zIBbVE3UfUD" }, "outputs": [], "source": [ "from IPython.display import display, Image\n", "import moviepy.editor as mpy\n", "display(mpy.ipython_display('demo_4X_100fps.mp4', height=256, max_duration=100.))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "tWkJCNgP3zXA" }, "outputs": [], "source": [ "!python3 inference_img.py --img demo/I0_0.png demo/I0_1.png\n", "ffmpeg -r 10 -f image2 -i output/img%d.png -s 448x256 -vf \"split[s0][s1];[s0]palettegen=stats_mode=single[p];[s1][p]paletteuse=new=1\" output/slomo.gif\n", "# Image interpolation" ] } ], "metadata": { "accelerator": "GPU", "colab": { "include_colab_link": true, "name": "Untitled0.ipynb", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 0 }