Files
nerfstudio/pyrad/viewer
Ethan Weberandevonneng bf13ed3cf3 Integrating WebRTC into viewer (#73)
* restructuring for webrtc integration

* some webrtc code but not working

* webrtc connects when muted

* the flag is real!

* updating camera in websocket bridge. moved webrtc to existing websocket connection instead of http request. need to change video track

* rudimentary adding real-time imaging

* added free TURN server so code works everywhere

* slow rendering works during training with the viewer

* fix tensor device and update default model save dir

* forgot to include trainer updates

* removing some code that isn't needed

* quick fix to bins. not the most accurate however

* cleaned up code and added some config logic

* black

* adding license

Co-authored-by: evonneng <evonne_ng@berkeley.edu>
2022-07-05 14:52:49 -07:00
..
2022-07-05 14:52:49 -07:00
2022-06-08 13:31:13 -07:00

Viewer

Backend (backend/)

The backend faciliates communication between Python code and the ReactJS client application.

cd backend
python run_zmq_server.py

It should print out something of the form:
"ZMQWebSocketBridge using zmq_url=tcp://127.0.0.1:6000 and websocket_port=8051"

Client (app/)

The ReactJS client code is in the app folder. First, install the most recent version of node.

cd app

# install yarn and package.json dependencies
npm install --global yarn
yarn install

# start the application
yarn start

# forward port and open in your local browser
# the URL takes the following form
# http://localhost:<forwarded_react_port>/localhost:<forwarded_backend_tcp_port>
http://localhost:4000/localhost:8051

Possibly edit the port in app/.env.development file with the following:

BROWSER=none
FAST_REFRESH=false
HOST=localhost
PORT=4000

Establishing the connection from Python

See notebooks/visualize_viewer.ipynb for a quick overview of how to interact with the viewer.


How to use with VNC

This section is more experimental and shouldn't be used right now. Eventually it would be nice to support an Electron app for local use instead of using a web browser (e.g., Chrome).

https://tigervnc.org/doc/Xvnc.html

# start vnc server
/opt/TurboVNC/bin/Xvnc :5017 -rfbport 5017 -SecurityTypes none -localsts

# run the application. TODO: get electron to work!
alias wgui='vglrun -d :0.0'
export DISPLAY=:5017
wgui chromium-browser http://localhost:3000/localhost:8051

The server communication code is in the comms folder.