Skip to content

Commit

Permalink
i'm so fancy
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarx committed Oct 7, 2022
1 parent 5e0c7c0 commit ef01278
Showing 1 changed file with 70 additions and 20 deletions.
90 changes: 70 additions & 20 deletions Video_Killed_The_Radio_Star_Defusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"id": "mgXxoDhMAiti"
},
"source": [
"# Video Killed The Radio Star ...Diffusion.\n",
"# $Video \\text{ } Killed \\text{ } The \\text{ } Radio \\text{ } Star$ $...Diffusion.$\n",
"\n",
"Notebook by David Marx ([@DigThatData](https://twitter.com/digthatdata))\n",
"\n",
"Shared under MIT license\n",
"\n",
"\n",
"## FAQ\n",
"# $\\text{FAQ}$\n",
"\n",
"**What is this?**\n",
"\n",
Expand Down Expand Up @@ -65,6 +65,15 @@
"This notebook was made possible thanks to ongoing support from [stability.ai](https://stability.ai/). The best way to support my work is to share it with your friends, [report bugs](https://github.com/dmarx/video-killed-the-radio-star/issues/new), [suggest features](https://github.com/dmarx/video-killed-the-radio-star/discussions) or to donate to open source non-profits :) "
]
},
{
"cell_type": "markdown",
"source": [
"## $0.$ Setup"
],
"metadata": {
"id": "sM147HP4kAdY"
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -75,7 +84,8 @@
"outputs": [],
"source": [
"%%capture\n",
"# @title # 0. 🛠️ Setup\n",
"\n",
"# @title # 🛠️ Installations\n",
"!pip install vktrs[api,hf]\n",
"\n",
"!pip install git+https://github.com/openai/whisper\n",
Expand All @@ -97,7 +107,7 @@
},
"outputs": [],
"source": [
"# @markdown # 📊 Check GPU Status\n",
"# @title # 📊 Check GPU Status\n",
"\n",
"from vktrs.utils import gpu_info\n",
"\n",
Expand All @@ -113,7 +123,7 @@
},
"outputs": [],
"source": [
"# @title # 1. 🔑 Provide your API Key\n",
"# @title # 🔑 Provide your API Key\n",
"# @markdown Running this cell will prompt you to enter your API Key below. \n",
"\n",
"# @markdown To get your API key, visit https://beta.dreamstudio.ai/membership\n",
Expand Down Expand Up @@ -192,13 +202,25 @@
" OmegaConf.save(config=cfg, f=fp.name)"
]
},
{
"cell_type": "markdown",
"source": [
"## $1.$ Create New Project"
],
"metadata": {
"id": "rt9Mu97fk_bp"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"cellView": "form",
"id": "s-9xjgy0iHhS"
},
"outputs": [],
"source": [
"# @markdown Create New Project\n",
"# @title ## 📋 Set Project Name\n",
"\n",
"# @markdown To create a new project, enter a unique project name.\n",
"# @markdown If you leave `project_name` blank, the current unix timestamp will be used\n",
Expand All @@ -219,6 +241,15 @@
" OmegaConf.save(config=workspace, f=fp.name)"
]
},
{
"cell_type": "markdown",
"source": [
"## $2.$ Audio processing"
],
"metadata": {
"id": "7eTPNhcBomtL"
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -228,7 +259,7 @@
},
"outputs": [],
"source": [
"# @title # 2. 📋 Audio processing parameters\n",
"# @title 📋 Parameters\n",
"\n",
"from omegaconf import OmegaConf\n",
"from pathlib import Path\n",
Expand Down Expand Up @@ -307,7 +338,7 @@
"source": [
"%%capture\n",
"\n",
"# @title # 3. 📥 Download audio from youtube\n",
"# @title ## 📥 Download audio from youtube\n",
"\n",
"from vktrs.utils import get_audio_duration_seconds\n",
"from vktrs.youtube import (\n",
Expand Down Expand Up @@ -400,7 +431,7 @@
},
"outputs": [],
"source": [
"# @title # 4. 💬 Transcribe and segment speech using whisper\n",
"# @title ## 💬 Transcribe and segment speech using whisper\n",
"\n",
"# handle OOM... or try to, anyway\n",
"if 'hf_helper' in locals():\n",
Expand Down Expand Up @@ -552,6 +583,15 @@
"pn.widgets.Tabulator(df, formatters=tabulator_formatters)"
]
},
{
"cell_type": "markdown",
"source": [
"## $3.$🧮 Math"
],
"metadata": {
"id": "mkPO7_cVpRU3"
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -561,8 +601,6 @@
},
"outputs": [],
"source": [
"# @title # 5. 🧮 Math\n",
"\n",
"# to do: move this to video compilation\n",
"\n",
"import datetime as dt\n",
Expand Down Expand Up @@ -649,6 +687,15 @@
" OmegaConf.save(config=storyboard, f=fp.name)"
]
},
{
"cell_type": "markdown",
"source": [
"## $4.$ Animate"
],
"metadata": {
"id": "_RTUFeyQqCfd"
}
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -658,7 +705,7 @@
},
"outputs": [],
"source": [
"# @title # 6. 🎨 Generate init images\n",
"# @title ## 🎨 Generate init images\n",
"\n",
"import copy\n",
"import datetime as dt\n",
Expand Down Expand Up @@ -910,7 +957,7 @@
},
"outputs": [],
"source": [
"# @title # 7. 🚀 Generate animation frames\n",
"# @title ## 🚀 Generate animation frames\n",
"\n",
"from omegaconf import OmegaConf\n",
"from PIL import Image\n",
Expand Down Expand Up @@ -1030,7 +1077,7 @@
},
"outputs": [],
"source": [
"# @title # 8. 🎥 Compile your video!\n",
"# @title ## 🎥 Compile your video!\n",
"\n",
"from subprocess import Popen, PIPE\n",
"\n",
Expand Down Expand Up @@ -1123,11 +1170,12 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form"
"cellView": "form",
"id": "NmUedPP4iHhX"
},
"outputs": [],
"source": [
"# @title # 9. 📺 Enjoy your animation!\n",
"# @title ## 📺 Enjoy your animation!\n",
"\n",
"output_filename = storyboard.params.output_filename\n",
"\n",
Expand Down Expand Up @@ -1159,9 +1207,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "aVu_TleBiHhY"
},
"source": [
"## ⚖️ I put on my robe and lawyer hat\n",
"# ⚖️ I put on my robe and lawyer hat\n",
"\n",
"### Notebook license\n",
"\n",
Expand Down Expand Up @@ -1239,4 +1289,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit ef01278

Please sign in to comment.