Update colab links to use repo colab (#866)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-10-31 10:22:25 -07:00
1 parent b088e230f6
commit e3e766c5ca
5 files changed
+228 -170

No files matched your search

+172 -165
View File
@@ -1,35 +1,20 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"gpuClass": "standard"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/nerfstudio-project/nerfstudio/tree/main/colab/demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/main/colab/demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SiiXJ7K_fePG"
},
"source": [
"<p align=\"center\">\n",
" <picture>\n",
@@ -50,13 +35,13 @@
"\\\\\n",
"\n",
"Credit to [NeX](https://nex-mpi.github.io/) for Google Colab format."
],
"metadata": {
"id": "SiiXJ7K_fePG"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Yyx5h6kz5ga7"
},
"source": [
"## Frequently Asked Questions\n",
"\n",
@@ -70,32 +55,22 @@
"\n",
"* **Other problems?**\n",
" * Feel free to create an issue on our [GitHub repo](https://github.com/nerfstudio-project/nerfstudio).\n"
],
"metadata": {
"id": "Yyx5h6kz5ga7"
}
]
},
{
"cell_type": "code",
"source": [
"#@title # Install Conda (requires runtime restart) { vertical-output: true, display-mode: \"form\" }\n",
"\n",
"!pip install -q condacolab\n",
"import condacolab\n",
"condacolab.install()"
],
"execution_count": null,
"metadata": {
"id": "RGr33zHaHak0",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RGr33zHaHak0",
"outputId": "86df0e7f-35fe-4b79-8c0e-83692d42b124"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n",
"📦 Installing...\n",
@@ -105,10 +80,22 @@
"🔁 Restarting kernel...\n"
]
}
],
"source": [
"#@title # Install Conda (requires runtime restart) { vertical-output: true, display-mode: \"form\" }\n",
"\n",
"!pip install -q condacolab\n",
"import condacolab\n",
"condacolab.install()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "9oyLHl8QfYwP"
},
"outputs": [],
"source": [
"#@title # Install Nerfstudio and Dependencies (~10 min) { vertical-output: true, display-mode: \"form\" }\n",
"\n",
@@ -128,15 +115,33 @@
"# Install nerfstudio\n",
"%cd /content/\n",
"!pip install nerfstudio"
],
"metadata": {
"id": "9oyLHl8QfYwP"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "msVLprI4gRA4",
"outputId": "c5eb5997-37d9-4c9f-a3d2-7b67f4b6d346"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/content\n",
"Downloading...\n",
"From: https://drive.google.com/uc?id=1dmjWGXlJnUxwosN6MVooCDQe970PkD-1\n",
"To: /content/data/nerfstudio/poster.zip\n",
"100% 750M/750M [00:03<00:00, 218MB/s]\n",
"\u001b[0m"
]
}
],
"source": [
"#@markdown <h1> Downloading Data</h1>\n",
"#@markdown <h3>Pick the preset scene or upload your own images/video</h3>\n",
@@ -175,33 +180,31 @@
" !ns-process-data video --data $video_path --output-dir /content/data/nerfstudio/custom_data/\n",
"\n",
" scene = \"custom_data\""
],
"metadata": {
"id": "msVLprI4gRA4",
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "c5eb5997-37d9-4c9f-a3d2-7b67f4b6d346"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content\n",
"Downloading...\n",
"From: https://drive.google.com/uc?id=1dmjWGXlJnUxwosN6MVooCDQe970PkD-1\n",
"To: /content/data/nerfstudio/poster.zip\n",
"100% 750M/750M [00:03<00:00, 218MB/s]\n",
"\u001b[0m"
]
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Eju-3p2hjcB2",
"outputId": "c9ff081c-2436-44c6-d292-f22dc3ef78b5"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/content\n",
"\u001b[K\u001b[?25h/tools/node/bin/lt -> /tools/node/lib/node_modules/localtunnel/bin/lt.js\n",
"+ localtunnel@2.0.2\n",
"added 22 packages from 22 contributors in 1.536s\n"
]
}
],
"source": [
"#@title # Set Up Viewer\n",
"\n",
@@ -214,31 +217,51 @@
"# Tunnel port 7007, the default for\n",
"!rm url.txt 2> /dev/null\n",
"get_ipython().system_raw('lt --port 7007 >> url.txt 2>&1 &')"
],
"metadata": {
"id": "Eju-3p2hjcB2",
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "c9ff081c-2436-44c6-d292-f22dc3ef78b5"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content\n",
"\u001b[K\u001b[?25h/tools/node/bin/lt -> /tools/node/lib/node_modules/localtunnel/bin/lt.js\n",
"+ localtunnel@2.0.2\n",
"added 22 packages from 22 contributors in 1.536s\n"
]
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 857
},
"id": "VoKDxqEcjmfC",
"outputId": "b966821b-7d18-43ee-ceb3-724ac2d0c022"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://viewer.nerf.studio/?websocket_url=wss://good-ways-ask-34-83-255-230.loca.lt\n",
"You may need to click Refresh Page after you start training!\n"
]
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"800\"\n",
" src=\"https://viewer.nerf.studio/?websocket_url=wss://good-ways-ask-34-83-255-230.loca.lt\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7efe3a65e150>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#@title # Start Viewer\n",
"\n",
@@ -254,101 +277,38 @@
"print(\"You may need to click Refresh Page after you start training!\")\n",
"from IPython import display\n",
"display.IFrame(src=url, height=800, width=\"100%\")"
],
"metadata": {
"id": "VoKDxqEcjmfC",
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 857
},
"outputId": "b966821b-7d18-43ee-ceb3-724ac2d0c022"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"https://viewer.nerf.studio/?websocket_url=wss://good-ways-ask-34-83-255-230.loca.lt\n",
"You may need to click Refresh Page after you start training!\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<IPython.lib.display.IFrame at 0x7efe3a65e150>"
],
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"800\"\n",
" src=\"https://viewer.nerf.studio/?websocket_url=wss://good-ways-ask-34-83-255-230.loca.lt\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
]
},
"metadata": {},
"execution_count": 4
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "m_N8_cLfjoXD"
},
"outputs": [],
"source": [
"#@title # Start Training { vertical-output: true }\n",
"\n",
"%cd /content\n",
"!ns-train nerfacto --viewer.websocket-port 7007 nerfstudio-data --data data/nerfstudio/$scene --downscale-factor 4"
],
"metadata": {
"id": "m_N8_cLfjoXD",
"cellView": "form"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"source": [
"#@title # Render Video { vertical-output: true }\n",
"#@markdown <h3>Export the camera path from within the viewer, then run this cell.</h3>\n",
"#@markdown <h5>The rendered video should be at renders/output.mp4!</h5>\n",
"\n",
"\n",
"base_dir = \"/content/outputs/data-nerfstudio-\" + scene + \"/nerfacto/\"\n",
"training_run_dir = base_dir + os.listdir(base_dir)[0]\n",
"\n",
"from IPython.core.display import display, HTML\n",
"display(HTML('<h3>Upload the camera path JSON.</h3>'))\n",
"%cd $training_run_dir\n",
"uploaded = files.upload()\n",
"uploaded_camera_path_filename = list(uploaded.keys())[0]\n",
"\n",
"config_filename = training_run_dir + \"/config.yml\"\n",
"camera_path_filename = training_run_dir + \"/\" + uploaded_camera_path_filename\n",
"camera_path_filename = camera_path_filename.replace(\" \", \"\\\\ \").replace(\"(\", \"\\\\(\").replace(\")\", \"\\\\)\")\n",
"\n",
"%cd /content/\n",
"!ns-render --load-config $config_filename --traj filename --camera-path-filename $camera_path_filename --output-path renders/output.mp4"
],
"execution_count": null,
"metadata": {
"id": "WGt8ukG6Htg3",
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "fa946890-c7d8-4e46-a54e-7231bc5a2059",
"cellView": "form"
"id": "WGt8ukG6Htg3",
"outputId": "fa946890-c7d8-4e46-a54e-7231bc5a2059"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[2;36m[19:48:48]\u001b[0m\u001b[2;36m \u001b[0mSkipping \u001b[1;36m0\u001b[0m files in dataset split train. \u001b]8;id=527413;file:///content/nerfstudio/nerfstudio/data/dataparsers/nerfstudio_dataparser.py\u001b\\\u001b[2mnerfstudio_dataparser.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=243595;file:///content/nerfstudio/nerfstudio/data/dataparsers/nerfstudio_dataparser.py#91\u001b\\\u001b[2m91\u001b[0m\u001b]8;;\u001b\\\n",
"\u001b[2;36m \u001b[0m\u001b[2;36m \u001b[0mSkipping \u001b[1;36m0\u001b[0m files in dataset split test. \u001b]8;id=109270;file:///content/nerfstudio/nerfstudio/data/dataparsers/nerfstudio_dataparser.py\u001b\\\u001b[2mnerfstudio_dataparser.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=464675;file:///content/nerfstudio/nerfstudio/data/dataparsers/nerfstudio_dataparser.py#91\u001b\\\u001b[2m91\u001b[0m\u001b]8;;\u001b\\\n",
@@ -371,7 +331,54 @@
"\u001b[0m"
]
}
],
"source": [
"#@title # Render Video { vertical-output: true }\n",
"#@markdown <h3>Export the camera path from within the viewer, then run this cell.</h3>\n",
"#@markdown <h5>The rendered video should be at renders/output.mp4!</h5>\n",
"\n",
"\n",
"base_dir = \"/content/outputs/data-nerfstudio-\" + scene + \"/nerfacto/\"\n",
"training_run_dir = base_dir + os.listdir(base_dir)[0]\n",
"\n",
"from IPython.core.display import display, HTML\n",
"display(HTML('<h3>Upload the camera path JSON.</h3>'))\n",
"%cd $training_run_dir\n",
"uploaded = files.upload()\n",
"uploaded_camera_path_filename = list(uploaded.keys())[0]\n",
"\n",
"config_filename = training_run_dir + \"/config.yml\"\n",
"camera_path_filename = training_run_dir + \"/\" + uploaded_camera_path_filename\n",
"camera_path_filename = camera_path_filename.replace(\" \", \"\\\\ \").replace(\"(\", \"\\\\(\").replace(\")\", \"\\\\)\")\n",
"\n",
"%cd /content/\n",
"!ns-render --load-config $config_filename --traj filename --camera-path-filename $camera_path_filename --output-path renders/output.mp4"
]
}
]
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"include_colab_link": true,
"provenance": []
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3.8.12 ('nerfactory')",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.8.12"
},
"vscode": {
"interpreter": {
"hash": "34c28001ff35fb390494047002768a8182dcf55b1b11415165e62ea61557ab83"
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}