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

+8 -11
View File
@@ -6,7 +6,6 @@ from __future__ import annotations
import dataclasses
import json
import logging
import sys
from pathlib import Path
from typing import Literal, Optional
@@ -32,9 +31,7 @@ from nerfstudio.utils import install_checks
from nerfstudio.utils.eval_utils import eval_setup
from nerfstudio.utils.rich_utils import ItersPerSecColumn
console = Console(width=120)
logging.basicConfig(format="[%(filename)s:%(lineno)d] %(message)s", level=logging.INFO)
CONSOLE = Console(width=120)
def _render_trajectory_video(
@@ -55,7 +52,7 @@ def _render_trajectory_video(
rendered_resolution_scaling_factor: Scaling factor to apply to the camera image resolution.
seconds: Number for the output video.
"""
console.print("[bold green]Creating trajectory video")
CONSOLE.print("[bold green]Creating trajectory video")
images = []
cameras.rescale_output_resolution(rendered_resolution_scaling_factor)
@@ -72,9 +69,9 @@ def _render_trajectory_video(
with torch.no_grad():
outputs = pipeline.model.get_outputs_for_camera_ray_bundle(camera_ray_bundle)
if rendered_output_name not in outputs:
console.rule("Error", style="red")
console.print(f"Could not find {rendered_output_name} in the model outputs", justify="center")
console.print(f"Please set --rendered_output_name to one of: {outputs.keys()}", justify="center")
CONSOLE.rule("Error", style="red")
CONSOLE.print(f"Could not find {rendered_output_name} in the model outputs", justify="center")
CONSOLE.print(f"Please set --rendered_output_name to one of: {outputs.keys()}", justify="center")
sys.exit(1)
image = outputs[rendered_output_name].cpu().numpy()
images.append(image)
@@ -82,10 +79,10 @@ def _render_trajectory_video(
fps = len(images) / seconds
# make the folder if it doesn't exist
output_filename.parent.mkdir(parents=True, exist_ok=True)
with console.status("[yellow]Saving video", spinner="bouncingBall"):
with CONSOLE.status("[yellow]Saving video", spinner="bouncingBall"):
media.write_video(output_filename, images, fps=fps)
console.rule("[green] :tada: :tada: :tada: Success :tada: :tada: :tada:")
console.print(f"[green]Saved video to {output_filename}", justify="center")
CONSOLE.rule("[green] :tada: :tada: :tada: Success :tada: :tada: :tada:")
CONSOLE.print(f"[green]Saved video to {output_filename}", justify="center")
@dataclasses.dataclass