|
74 | 74 | "\n", |
75 | 75 | "%cd /content/\n", |
76 | 76 | "!pip install --upgrade pip\n", |
77 | | - "!pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118\n", |
| 77 | + "!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", |
78 | 78 | "\n", |
79 | 79 | "# Installing TinyCuda\n", |
80 | 80 | "%cd /content/\n", |
|
166 | 166 | "print(\"Data Processing Succeeded!\")" |
167 | 167 | ] |
168 | 168 | }, |
169 | | - { |
170 | | - "cell_type": "code", |
171 | | - "execution_count": null, |
172 | | - "metadata": { |
173 | | - "cellView": "form", |
174 | | - "colab": { |
175 | | - "base_uri": "https://localhost:8080/", |
176 | | - "height": 928 |
177 | | - }, |
178 | | - "id": "VoKDxqEcjmfC", |
179 | | - "outputId": "d2919aa4-96dd-4e50-829f-289e4208882b" |
180 | | - }, |
181 | | - "outputs": [ |
182 | | - { |
183 | | - "name": "stdout", |
184 | | - "output_type": "stream", |
185 | | - "text": [ |
186 | | - "/content\n", |
187 | | - "\u001b[K\u001b[?25h/tools/node/bin/lt -> /tools/node/lib/node_modules/localtunnel/bin/lt.js\n", |
188 | | - "\u001b[K\u001b[?25h+ localtunnel@2.0.2\n", |
189 | | - "added 22 packages from 22 contributors in 2.07s\n", |
190 | | - "https://viewer.nerf.studio/?websocket_url=wss://cyan-facts-matter-34-91-1-218.loca.lt\n", |
191 | | - "You may need to click Refresh Page after you start training!\n" |
192 | | - ] |
193 | | - }, |
194 | | - { |
195 | | - "data": { |
196 | | - "text/html": [ |
197 | | - "\n", |
198 | | - " <iframe\n", |
199 | | - " width=\"100%\"\n", |
200 | | - " height=\"800\"\n", |
201 | | - " src=\"https://viewer.nerf.studio/?websocket_url=wss://cyan-facts-matter-34-91-1-218.loca.lt\"\n", |
202 | | - " frameborder=\"0\"\n", |
203 | | - " allowfullscreen\n", |
204 | | - " ></iframe>\n", |
205 | | - " " |
206 | | - ], |
207 | | - "text/plain": [ |
208 | | - "<IPython.lib.display.IFrame at 0x7f1d0da6f950>" |
209 | | - ] |
210 | | - }, |
211 | | - "execution_count": 2, |
212 | | - "metadata": {}, |
213 | | - "output_type": "execute_result" |
214 | | - } |
215 | | - ], |
216 | | - "source": [ |
217 | | - "#@markdown <h1>Set up and Start Viewer</h1>\n", |
218 | | - "\n", |
219 | | - "%cd /content\n", |
220 | | - "\n", |
221 | | - "# Install localtunnel\n", |
222 | | - "# We are using localtunnel https://github.com/localtunnel/localtunnel but ngrok could also be used\n", |
223 | | - "!npm install -g localtunnel\n", |
224 | | - "\n", |
225 | | - "# Tunnel port 7007, the default for\n", |
226 | | - "!rm url.txt 2> /dev/null\n", |
227 | | - "get_ipython().system_raw('lt --port 7007 >> url.txt 2>&1 &')\n", |
228 | | - "\n", |
229 | | - "import time\n", |
230 | | - "time.sleep(3) # the previous command needs time to write to url.txt\n", |
231 | | - "\n", |
232 | | - "\n", |
233 | | - "with open('url.txt') as f:\n", |
234 | | - " lines = f.readlines()\n", |
235 | | - "websocket_url = lines[0].split(\": \")[1].strip().replace(\"https\", \"wss\")\n", |
236 | | - "# from nerfstudio.utils.io import load_from_json\n", |
237 | | - "# from pathlib import Path\n", |
238 | | - "# json_filename = \"nerfstudio/nerfstudio/viewer/app/package.json\"\n", |
239 | | - "# version = load_from_json(Path(json_filename))[\"version\"]\n", |
240 | | - "url = f\"https://viewer.nerf.studio/?websocket_url={websocket_url}\"\n", |
241 | | - "print(url)\n", |
242 | | - "print(\"You may need to click Refresh Page after you start training!\")\n", |
243 | | - "from IPython import display\n", |
244 | | - "display.IFrame(src=url, height=800, width=\"100%\")" |
245 | | - ] |
246 | | - }, |
247 | 169 | { |
248 | 170 | "cell_type": "code", |
249 | 171 | "execution_count": null, |
|
256 | 178 | "#@markdown <h1>Start Training</h1>\n", |
257 | 179 | "\n", |
258 | 180 | "%cd /content\n", |
| 181 | + "!pip install colab-xterm\n", |
| 182 | + "%load_ext colabxterm\n", |
| 183 | + "%env TERM=xterm\n", |
| 184 | + "from IPython.display import clear_output\n", |
| 185 | + "clear_output(wait=True)\n", |
259 | 186 | "if os.path.exists(f\"data/nerfstudio/{scene}/transforms.json\"):\n", |
260 | | - " !ns-train nerfacto --viewer.websocket-port 7007 nerfstudio-data --data data/nerfstudio/$scene --downscale-factor 4\n", |
| 187 | + " print(\"\\033[1m\" + \"Copy and paste the following command into the terminal window that pops up under this cell.\" + \"\\033[0m\")\n", |
| 188 | + " print(f\"ns-train nerfacto --viewer.websocket-port 7007 --viewer.make-share-url True nerfstudio-data --data data/nerfstudio/{scene} --downscale-factor 4\")\n", |
| 189 | + " print()\n", |
| 190 | + " %xterm\n", |
261 | 191 | "else:\n", |
262 | 192 | " from IPython.core.display import display, HTML\n", |
263 | 193 | " display(HTML('<h3 style=\"color:red\">Error: Data processing did not complete</h3>'))\n", |
|
0 commit comments