2020-11-14 06:57:03 +01:00
|
|
|
{
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 0,
|
|
|
|
"metadata": {
|
|
|
|
"colab": {
|
|
|
|
"name": "Untitled0.ipynb",
|
|
|
|
"provenance": [],
|
2020-11-16 09:21:01 +01:00
|
|
|
"authorship_tag": "ABX9TyPG71aIuYa9eAOjSiylJvyG",
|
2020-11-14 06:57:03 +01:00
|
|
|
"include_colab_link": true
|
|
|
|
},
|
|
|
|
"kernelspec": {
|
|
|
|
"name": "python3",
|
|
|
|
"display_name": "Python 3"
|
|
|
|
},
|
|
|
|
"accelerator": "GPU"
|
|
|
|
},
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {
|
|
|
|
"id": "view-in-github",
|
|
|
|
"colab_type": "text"
|
|
|
|
},
|
|
|
|
"source": [
|
2020-11-16 09:21:01 +01:00
|
|
|
"<a href=\"https://colab.research.google.com/github/hzwer/arXiv2020-RIFE/blob/main/Colab_demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
2020-11-14 06:57:03 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"metadata": {
|
|
|
|
"id": "FypCcZkNNt2p"
|
|
|
|
},
|
|
|
|
"source": [
|
|
|
|
"!git clone https://github.com/hzwer/arXiv2020-RIFE"
|
|
|
|
],
|
|
|
|
"execution_count": null,
|
|
|
|
"outputs": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"metadata": {
|
|
|
|
"id": "1wysVHxoN54f"
|
|
|
|
},
|
|
|
|
"source": [
|
2020-11-16 09:21:01 +01:00
|
|
|
"!gdown --id 1zYc3PEN4t6GOUoVYJjvcXoMmM3kFDNGS\n",
|
2020-11-16 10:33:59 +01:00
|
|
|
"!7z e RIFE_trained_model_v1.1.zip"
|
2020-11-14 06:57:03 +01:00
|
|
|
],
|
|
|
|
"execution_count": null,
|
|
|
|
"outputs": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"metadata": {
|
|
|
|
"id": "AhbHfRBJRAUt"
|
|
|
|
},
|
|
|
|
"source": [
|
|
|
|
"!mkdir /content/arXiv2020-RIFE/train_log\n",
|
2020-11-15 16:34:14 +01:00
|
|
|
"!mv *.pkl /content/arXiv2020-RIFE/train_log/\n",
|
|
|
|
"%cd /content/arXiv2020-RIFE/\n",
|
|
|
|
"!gdown --id 1i3xlKb7ax7Y70khcTcuePi6E7crO_dFc"
|
2020-11-14 06:57:03 +01:00
|
|
|
],
|
2020-11-15 16:34:14 +01:00
|
|
|
"execution_count": null,
|
2020-11-14 06:57:03 +01:00
|
|
|
"outputs": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {
|
|
|
|
"id": "rirngW5uRMdg"
|
|
|
|
},
|
|
|
|
"source": [
|
2020-11-15 16:34:14 +01:00
|
|
|
"Please upload your video to content/arXiv2020-RIFE/video.mp4, or use our demo video."
|
2020-11-14 06:57:03 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"metadata": {
|
|
|
|
"id": "dnLn4aHHPzN3"
|
|
|
|
},
|
|
|
|
"source": [
|
|
|
|
"!nvidia-smi\n",
|
2020-11-16 09:21:01 +01:00
|
|
|
"!python3 inference_mp4_4x.py --video demo.mp4 --montage --fps=60 --skip"
|
2020-11-14 06:57:03 +01:00
|
|
|
],
|
|
|
|
"execution_count": null,
|
|
|
|
"outputs": []
|
|
|
|
},
|
2020-11-16 06:24:13 +01:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {
|
|
|
|
"id": "77KK6lxHgJhf"
|
|
|
|
},
|
|
|
|
"source": [
|
|
|
|
"Our demo.mp4 is 24FPS. So 4X and run it under 60FPS will provide a slomo effect. You can adjust the parameters for your own perference."
|
|
|
|
]
|
|
|
|
},
|
2020-11-14 06:57:03 +01:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"metadata": {
|
|
|
|
"id": "0zIBbVE3UfUD"
|
|
|
|
},
|
|
|
|
"source": [
|
|
|
|
"from IPython.display import display, Image\n",
|
|
|
|
"import moviepy.editor as mpy\n",
|
2020-11-16 09:21:01 +01:00
|
|
|
"display(mpy.ipython_display('demo_4x.mp4', height=256, max_duration=100.))"
|
2020-11-14 06:57:03 +01:00
|
|
|
],
|
|
|
|
"execution_count": null,
|
|
|
|
"outputs": []
|
|
|
|
}
|
|
|
|
]
|
2020-11-16 10:33:59 +01:00
|
|
|
}
|