Record3D added to Colab (#926)

* record3d added to colab.

* Created using Colaboratory

* Created using Colaboratory
This commit is contained in:
Alexander Kristoffersen authored and GitHub committed 2022-11-10 17:32:42 -08:00
1 parent ad8599aad0
commit 4cf13857d0
1 file changed
+32 -20
+32 -20
View File
@@ -3,11 +3,11 @@
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<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>"
"<a href=\"https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/alex%2Frecord3d_colab/colab/demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
@@ -59,24 +59,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RGr33zHaHak0",
"outputId": "86df0e7f-35fe-4b79-8c0e-83692d42b124"
"outputId": "851bcce2-dce9-4cb4-8429-9ff0e27f73fe"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"name": "stdout",
"text": [
"⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n",
"📦 Installing...\n",
"📌 Adjusting configuration...\n",
"🩹 Patching environment...\n",
"⏲ Done in 0:00:23\n",
"⏲ Done in 0:00:19\n",
"🔁 Restarting kernel...\n"
]
}
@@ -119,26 +119,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "msVLprI4gRA4",
"outputId": "c5eb5997-37d9-4c9f-a3d2-7b67f4b6d346"
"outputId": "0be99061-71e1-4e33-98ab-5096db323841"
},
"outputs": [
{
"name": "stdout",
"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"
"100% 750M/750M [00:03<00:00, 199MB/s]\n",
"\u001b[0mData Processing Succeeded!\n"
]
}
],
@@ -149,12 +148,25 @@
"from google.colab import files\n",
"from IPython.core.display import display, HTML\n",
"\n",
"scene = '\\uD83D\\uDDBC poster' #@param ['🖼 poster', '🚜 dozer', '🌄 desolation', '📤 upload your images' , '🎥 upload your own video']\n",
"scene = '\\uD83D\\uDDBC poster' #@param ['🖼 poster', '🚜 dozer', '🌄 desolation', '📤 upload your images' , '🎥 upload your own video', '💽 upload your own Record3D data']\n",
"scene = ' '.join(scene.split(' ')[1:])\n",
"\n",
"if scene not in ['upload your images', 'upload your own video']:\n",
"if scene not in ['upload your images', 'upload your own video', 'upload your own Record3D data']:\n",
" %cd /content/\n",
" !ns-download-data --dataset=nerfstudio --capture=$scene\n",
"elif scene == 'upload your own Record3D data':\n",
" display(HTML('<h3>Zip your Record3D folder, and upload.</h3>'))\n",
" display(HTML('<h3>More information on Record3D can be found <a href=\"https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#record3d-capture\" target=\"_blank\">here</a>.</h3>'))\n",
" %cd /content/\n",
" !mkdir -p /content/data/nerfstudio/custom_data\n",
" %cd /content/data/nerfstudio/custom_data/\n",
" uploaded = files.upload()\n",
" dir = os.getcwd()\n",
" preupload_datasets = [os.path.join(dir, f) for f in uploaded.keys()]\n",
" record_3d_zipfile = preupload_datasets[0]\n",
" !unzip $record_3d_zipfile -d /content/data/nerfstudio/custom_data\n",
" custom_data_directory = glob.glob('/content/data/nerfstudio/custom_data/*')[0]\n",
" !ns-process-data record3d --data $custom_data_directory --output-dir /content/data/nerfstudio/custom_data/\n",
"else:\n",
" display(HTML('<h3>Select your custom data</h3>'))\n",
" display(HTML('<p/>You can select multiple images by pressing ctrl, cmd or shift and click.<p>'))\n",
@@ -179,7 +191,8 @@
" video_path = preupload_datasets[0]\n",
" !ns-process-data video --data $video_path --output-dir /content/data/nerfstudio/custom_data/\n",
"\n",
" scene = \"custom_data\""
" scene = \"custom_data\"\n",
"print(\"Data Processing Succeeded!\")"
]
},
{
@@ -283,7 +296,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "m_N8_cLfjoXD"
},
"outputs": [],
@@ -360,8 +372,8 @@
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"include_colab_link": true,
"provenance": []
"provenance": [],
"include_colab_link": true
},
"gpuClass": "standard",
"kernelspec": {
@@ -381,4 +393,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}