Google Colab support with viewer (#747)

* allows bridge server to run on a different machine

* added script

* update version

* starting docs

* update docs and scripts

* ngrok support

* use tcp

* moving webrtc outside bridge server. wop

* lazy commit

* lazy commit

* running code. webrtc not working

* lazy commit

* better logic for webrtc connection

* cleanup

* todo comment

* working webrtc

* removed logging

* fixing black

* fix eslint

* fix python version

* fix readme

* misc cleanup

* small docs fix

Co-authored-by: Ethan Weber <ethanweber@Ethans-MacBook-Pro.local>
This commit is contained in:
Ethan WeberandEthan Weber authored and GitHub committed 2022-10-14 15:05:28 -07:00
1 parent a4755a1349
commit d71c05f256
37 files changed
+324 -329

No files matched your search

+9 -8
View File
@@ -18,7 +18,6 @@
from __future__ import annotations
import logging
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
@@ -32,6 +31,7 @@ from nerfstudio.configs.config_utils import to_immutable_dict
# model instances
from nerfstudio.utils import writer
CONSOLE = Console(width=120)
# Pretty printing class
class PrintableConfig: # pylint: disable=too-few-public-methods
@@ -167,9 +167,11 @@ class ViewerConfig(PrintableConfig):
zmq_port: Optional[int] = None
"""The zmq port to connect to for communication. If None, find an available port."""
launch_bridge_server: bool = True
"""whether or not to launch the zmq bridge server"""
websocket_port: int = 7007
"""whether or not to launch the bridge server"""
websocket_port: Optional[int] = 7007
"""the default websocket port to connect to"""
ip_address: str = "0.0.0.0"
"""the ip address where the bridge server is running"""
num_rays_per_chunk: int = 32768
"""number of rays per chunk to render with viewer"""
@@ -249,10 +251,9 @@ class Config(PrintableConfig):
def print_to_terminal(self) -> None:
"""Helper to pretty print config to terminal"""
console = Console(width=120)
console.rule("Config")
console.print(self)
console.rule("")
CONSOLE.rule("Config")
CONSOLE.print(self)
CONSOLE.rule("")
def save_config(self) -> None:
"""Save config to base directory"""
@@ -260,5 +261,5 @@ class Config(PrintableConfig):
assert base_dir is not None
base_dir.mkdir(parents=True, exist_ok=True)
config_yaml_path = base_dir / "config.yml"
logging.info(f"Saving config to: {config_yaml_path}")
CONSOLE.log(f"Saving config to: {config_yaml_path}")
config_yaml_path.write_text(yaml.dump(self), "utf8")
+3 -3
View File
@@ -23,6 +23,7 @@ from typing import Any, Dict
from rich.console import Console
CONSOLE = Console()
# pylint: disable=import-outside-toplevel
# cannot use mutable types directly within dataclass; abstracting default factory calls
@@ -44,7 +45,6 @@ def convert_markup_to_ansi(markup_string: str) -> str:
Returns:
Text formatted via ANSI sequences.
"""
console = Console()
with console.capture() as out:
console.print(markup_string, soft_wrap=True)
with CONSOLE.capture() as out:
CONSOLE.print(markup_string, soft_wrap=True)
return out.get()