Skip to content

Commit

Permalink
Merge pull request #76 from AlphaGit/fixed-colab-dependency-versions
Browse files Browse the repository at this point in the history
Fixed colab dependency versions
  • Loading branch information
baowenbo committed May 25, 2020
2 parents 4e03a36 + 40c986f commit d69e455
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Colab_DAIN.ipynb
Expand Up @@ -42,7 +42,7 @@
"Enhancement by [Styler00Dollar](https://github.com/styler00dollar) aka \"sudo rm -rf / --no-preserve-root#8353\" on discord and [Alpha](https://github.com/AlphaGit). Please do not run this command in your linux terminal. It's rather meant as a joke.\n",
"\n",
"A simple guide:\n",
"- Copy the .ipynb-file to your drive.\n",
"- Upload the ` .ipynb` file to your Google Colab.\n",
"- Create a folder inside of Google Drive named \"DAIN\"\n",
"- Change the configurations in the next cell\n",
"- Run cells one by one\n",
Expand Down Expand Up @@ -161,7 +161,9 @@
"source": [
"# Install dependencies.\n",
"\n",
"This next step may take somewhere between 15-20 minutes. Run this only once at startup.\n"
"This next step may take somewhere between 15-20 minutes. Run this only once at startup.\n",
"\n",
"Look for the \"Finished installing dependencies\" message."
]
},
{
Expand All @@ -172,8 +174,11 @@
"colab": {}
},
"source": [
"!pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html\n",
"!pip install scipy==1.1.0\n",
"\n",
"from IPython.display import clear_output\n",
"!git clone https://github.com/styler00dollar/Colab-DAIN /content/DAIN\n",
"!git clone https://github.com/baowenbo/DAIN /content/DAIN\n",
"\n",
"# This takes a while. Just wait. ~15 minutes.\n",
"# Building DAIN.\n",
Expand All @@ -194,7 +199,9 @@
"\n",
"!CUDA_VISIBLE_DEVICES=0\n",
"\n",
"!sudo apt-get install imagemagick imagemagick-doc"
"!sudo apt-get install imagemagick imagemagick-doc\n",
"\n",
"print(\"Finished installing dependencies.\")"
],
"execution_count": 0,
"outputs": []
Expand Down Expand Up @@ -279,7 +286,7 @@
"%shell mkdir -p '{FRAME_OUTPUT_DIR}'\n",
"%cd /content/DAIN\n",
"\n",
"!python colab_interpolate.py --netName DAIN_slowmotion --time_step {fps/TARGET_FPS} --start_frame 1 --end_frame {pngs_generated_count} --frame_input_dir '{FRAME_INPUT_DIR}' --frame_output_dir '{FRAME_OUTPUT_DIR}'"
"!python -W ignore colab_interpolate.py --netName DAIN_slowmotion --time_step {fps/TARGET_FPS} --start_frame 1 --end_frame {pngs_generated_count} --frame_input_dir '{FRAME_INPUT_DIR}' --frame_output_dir '{FRAME_OUTPUT_DIR}'"
],
"execution_count": 0,
"outputs": []
Expand Down Expand Up @@ -341,7 +348,8 @@
"%cd {FRAME_OUTPUT_DIR}\n",
"%shell ffmpeg -i '/content/DAIN/{filename}' -acodec copy output-audio.aac\n",
"%shell ffmpeg -y -r {TARGET_FPS} -f image2 -pattern_type glob -i '*.png' -i output-audio.aac -shortest '/content/gdrive/My Drive/{OUTPUT_FILE_PATH}'\n",
"if(AUTO_REMOVE==True):\n",
"\n",
"if (AUTO_REMOVE):\n",
" !rm -rf {FRAME_OUTPUT_DIR}/*\n",
" !rm -rf output-audio.aac"
],
Expand All @@ -363,4 +371,4 @@
"outputs": []
}
]
}
}

0 comments on commit d69e455

Please sign in to comment.