mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 13:28:59 +08:00
Pipeline v2 (#258)
* Model class done, pipeline class still needs more visualization stuffs * Renaming the BaseDataContainer to DataloaderOutputs and adding documentation * Pushing more documentation, removing some trivial functions * Updating dict typing * Removing config dicts for collider * Passing tests * Pushing shell new dataloader * Saving work, need to fix NGP model's get_loss_dict and Pipeline * V1 of the ngp pipeline should be done. Need train script and debugging * Updating with latest instant-ngp code * Syntax updates from latest ngp graph code * Linter, removing unneeded code in new NGP graph code * Style * Should be good now. Linter is happy and the code is verbatum current instant-ngp * Everything done except novel view testing code * Fixing some nitpicks * Debugging dataloader * merged master * WOP. integrating pipeline with configs and notebook demo * removing model folder * a lot of name changing from Graph to Model * in progress... changing trainer to use pipeline... broken right now * pipeline code runs * switched to val dataset * makes run_eval.py work * updated configs for pipeline change * fixing test_run_train script * fixing black and linting * fix docs * small updates to trainer Co-authored-by: Jake Austin <jake-austin@berkeley.edu>
This commit is contained in:
1 parent
670c2a01db
commit
0b042be956
55 files changed
+8595
-8263
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import React, { createContext, useContext, useEffect, useRef } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { WebSocketContext } from '../WebSocket/WebSocket';
|
||||
|
||||
const WebRtcContext = createContext(null);
|
||||
@@ -74,12 +74,15 @@ export default function WebRtcWindow() {
|
||||
pcRef.current
|
||||
.createOffer()
|
||||
.then((offer) => {
|
||||
console.log('[webrtc] created offer');
|
||||
return pcRef.current.setLocalDescription(offer);
|
||||
})
|
||||
.then(() => {
|
||||
console.log('[webrtc] set local description');
|
||||
// wait for ICE gathering to complete
|
||||
return new Promise((resolve) => {
|
||||
if (pcRef.current.iceGatheringState === 'complete') {
|
||||
console.log('[webrtc] ICE gathering complete');
|
||||
resolve();
|
||||
} else {
|
||||
const checkState = () => {
|
||||
@@ -100,6 +103,7 @@ export default function WebRtcWindow() {
|
||||
})
|
||||
.then(() => {
|
||||
// send the offer
|
||||
console.log('[webrtc] sending offer');
|
||||
const offer = pcRef.current.localDescription;
|
||||
const cmd = 'offer';
|
||||
const path = '';
|
||||
@@ -129,6 +133,7 @@ export default function WebRtcWindow() {
|
||||
websocket.addEventListener('open', () => {
|
||||
// connect webrtc when the websocket is connected
|
||||
pcRef.current = getRTCPeerConnection();
|
||||
console.log('sending offer');
|
||||
sendOffer();
|
||||
});
|
||||
}, []); // empty dependency array means only run once
|
||||
|
||||
@@ -26,9 +26,9 @@ import torch
|
||||
|
||||
from nerfactory.cameras.cameras import get_camera, get_intrinsics_from_intrinsics_matrix
|
||||
from nerfactory.cameras.rays import RayBundle
|
||||
from nerfactory.data.image_dataset import ImageDataset
|
||||
from nerfactory.data.structs import DatasetInputs
|
||||
from nerfactory.graphs.base import Graph
|
||||
from nerfactory.dataloaders.image_dataset import ImageDataset
|
||||
from nerfactory.dataloaders.structs import DatasetInputs
|
||||
from nerfactory.models.base import Model
|
||||
from nerfactory.utils import profiler
|
||||
from nerfactory.utils.config import ViewerConfig
|
||||
from nerfactory.utils.decorators import check_visualizer_enabled, decorate_all
|
||||
@@ -64,7 +64,7 @@ class RenderThread(threading.Thread):
|
||||
camera_ray_bundle: input rays to pass through the graph to render out
|
||||
"""
|
||||
|
||||
def __init__(self, state: "VisualizerState", graph: Graph, camera_ray_bundle: RayBundle):
|
||||
def __init__(self, state: "VisualizerState", graph: Model, camera_ray_bundle: RayBundle):
|
||||
threading.Thread.__init__(self)
|
||||
self.state = state
|
||||
self.graph = graph
|
||||
@@ -211,7 +211,7 @@ class VisualizerState:
|
||||
# K = camera.get_intrinsics_matrix()
|
||||
# set_persp_intrinsics_matrix(self.vis, K.double().numpy())
|
||||
|
||||
def update_scene(self, step: int, graph: Graph) -> None:
|
||||
def update_scene(self, step: int, graph: Model) -> None:
|
||||
"""updates the scene based on the graph weights
|
||||
|
||||
Args:
|
||||
@@ -291,7 +291,7 @@ class VisualizerState:
|
||||
self.vis["renderingState/train_eta"].write("Paused")
|
||||
|
||||
@profiler.time_function
|
||||
def _render_image_in_viewer(self, graph: Graph) -> None:
|
||||
def _render_image_in_viewer(self, graph: Model) -> None:
|
||||
"""
|
||||
Draw an image using the current camera pose from the viewer.
|
||||
The image is sent of a TCP connection and then uses WebRTC to send it to the viewer.
|
||||
|
||||
Reference in new issue
Block a user