-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nerfstudio-project:main' into main
- Loading branch information
Showing
31 changed files
with
600 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ | |
"\n", | ||
"%cd /content/\n", | ||
"!pip install --upgrade pip\n", | ||
"!pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118\n", | ||
"!pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118\n", | ||
"\n", | ||
"# Installing TinyCuda\n", | ||
"%cd /content/\n", | ||
|
@@ -166,84 +166,6 @@ | |
"print(\"Data Processing Succeeded!\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"cellView": "form", | ||
"colab": { | ||
"base_uri": "https://localhost:8080/", | ||
"height": 928 | ||
}, | ||
"id": "VoKDxqEcjmfC", | ||
"outputId": "d2919aa4-96dd-4e50-829f-289e4208882b" | ||
}, | ||
"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", | ||
"\u001b[K\u001b[?25h+ [email protected]\n", | ||
"added 22 packages from 22 contributors in 2.07s\n", | ||
"https://viewer.nerf.studio/?websocket_url=wss://cyan-facts-matter-34-91-1-218.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://cyan-facts-matter-34-91-1-218.loca.lt\"\n", | ||
" frameborder=\"0\"\n", | ||
" allowfullscreen\n", | ||
" ></iframe>\n", | ||
" " | ||
], | ||
"text/plain": [ | ||
"<IPython.lib.display.IFrame at 0x7f1d0da6f950>" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"#@markdown <h1>Set up and Start Viewer</h1>\n", | ||
"\n", | ||
"%cd /content\n", | ||
"\n", | ||
"# Install localtunnel\n", | ||
"# We are using localtunnel https://github.com/localtunnel/localtunnel but ngrok could also be used\n", | ||
"!npm install -g localtunnel\n", | ||
"\n", | ||
"# 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 &')\n", | ||
"\n", | ||
"import time\n", | ||
"time.sleep(3) # the previous command needs time to write to url.txt\n", | ||
"\n", | ||
"\n", | ||
"with open('url.txt') as f:\n", | ||
" lines = f.readlines()\n", | ||
"websocket_url = lines[0].split(\": \")[1].strip().replace(\"https\", \"wss\")\n", | ||
"# from nerfstudio.utils.io import load_from_json\n", | ||
"# from pathlib import Path\n", | ||
"# json_filename = \"nerfstudio/nerfstudio/viewer/app/package.json\"\n", | ||
"# version = load_from_json(Path(json_filename))[\"version\"]\n", | ||
"url = f\"https://viewer.nerf.studio/?websocket_url={websocket_url}\"\n", | ||
"print(url)\n", | ||
"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%\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -256,8 +178,16 @@ | |
"#@markdown <h1>Start Training</h1>\n", | ||
"\n", | ||
"%cd /content\n", | ||
"!pip install colab-xterm\n", | ||
"%load_ext colabxterm\n", | ||
"%env TERM=xterm\n", | ||
"from IPython.display import clear_output\n", | ||
"clear_output(wait=True)\n", | ||
"if os.path.exists(f\"data/nerfstudio/{scene}/transforms.json\"):\n", | ||
" !ns-train nerfacto --viewer.websocket-port 7007 nerfstudio-data --data data/nerfstudio/$scene --downscale-factor 4\n", | ||
" print(\"\\033[1m\" + \"Copy and paste the following command into the terminal window that pops up under this cell.\" + \"\\033[0m\")\n", | ||
" print(f\"ns-train nerfacto --viewer.websocket-port 7007 --viewer.make-share-url True nerfstudio-data --data data/nerfstudio/{scene} --downscale-factor 4\")\n", | ||
" print()\n", | ||
" %xterm\n", | ||
"else:\n", | ||
" from IPython.core.display import display, HTML\n", | ||
" display(HTML('<h3 style=\"color:red\">Error: Data processing did not complete</h3>'))\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Zip-NeRF | ||
|
||
<h4>A pytorch implementation of "Zip-NeRF: Anti-Aliased Grid-Based Neural Radiance Fields"</h4> | ||
|
||
```{button-link} https://jonbarron.info/zipnerf/ | ||
:color: primary | ||
:outline: | ||
Paper Website | ||
``` | ||
```{button-link} https://github.com/SuLvXiangXin/zipnerf-pytorch | ||
:color: primary | ||
:outline: | ||
Code | ||
``` | ||
### Installation | ||
First, install nerfstudio and its dependencies. Then run: | ||
``` | ||
pip install git+https://github.com/SuLvXiangXin/zipnerf-pytorch#subdirectory=extensions/cuda | ||
pip install git+https://github.com/SuLvXiangXin/zipnerf-pytorch | ||
``` | ||
Finally, install torch_scatter corresponding to your cuda version(https://pytorch-geometric.com/whl/torch-2.0.1%2Bcu118.html). | ||
|
||
|
||
### Running Model | ||
|
||
```bash | ||
ns-train zipnerf --data {DATA_DIR/SCENE} | ||
``` | ||
|
||
## Overview | ||
Zipnerf combines mip-NeRF 360’s overall framework with iNGP’s featurization approach. | ||
Following mip-NeRF, zipnerf assume each pixel corresponds to a cone. Given an interval along the ray, it construct a set of multisamples that approximate the shape of that conical frustum. | ||
Also, it present an alternative loss that, unlike mip-NeRF 360’s interlevel loss, is continuous and smooth with respect to distance along the ray to prevent z-aliasing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.