mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 10:29:51 +08:00
added basic stats to viewer (#259)
This commit is contained in:
1 parent
543f3e2e3b
commit
29a6e02c07
4 files changed
+82
-16
No files matched your search
@@ -31,6 +31,12 @@ export function RenderControls() {
|
||||
const field_of_view = useSelector(
|
||||
(state) => state.renderingState.field_of_view,
|
||||
);
|
||||
let eval_fps = useSelector(
|
||||
(state) => state.renderingState.eval_fps,
|
||||
);
|
||||
let train_eta = useSelector(
|
||||
(state) => state.renderingState.train_eta,
|
||||
);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -111,18 +117,8 @@ export function RenderControls() {
|
||||
};
|
||||
|
||||
const [, setControls] = useControls(
|
||||
'Rendering State',
|
||||
'Rendering Controls',
|
||||
() => ({
|
||||
// WebSocket isConnected
|
||||
// button does nothing except be an indicator
|
||||
'WebSocket Connected': button(() => {}, {
|
||||
disabled: !isWebsocketConnected,
|
||||
}),
|
||||
// webRTC isConnected
|
||||
// button does nothing except be an indicator
|
||||
'WebRTC Connected': button(() => {}, {
|
||||
disabled: !isWebrtcConnected,
|
||||
}),
|
||||
// isTraining
|
||||
'Pause Training': button(
|
||||
() => {
|
||||
@@ -220,8 +216,6 @@ export function RenderControls() {
|
||||
},
|
||||
}),
|
||||
[
|
||||
isWebsocketConnected,
|
||||
isWebrtcConnected,
|
||||
isTraining,
|
||||
outputOptions,
|
||||
outputChoice,
|
||||
@@ -231,6 +225,38 @@ export function RenderControls() {
|
||||
],
|
||||
);
|
||||
|
||||
const [, setState] = useControls(
|
||||
'Rendering Monitor',
|
||||
() => ({
|
||||
// WebSocket isConnected
|
||||
// button does nothing except be an indicator
|
||||
'WebSocket Connected': button(() => {}, {
|
||||
disabled: !isWebsocketConnected,
|
||||
}),
|
||||
// webRTC isConnected
|
||||
// button does nothing except be an indicator
|
||||
'WebRTC Connected': button(() => {}, {
|
||||
disabled: !isWebrtcConnected,
|
||||
}),
|
||||
eval_fps: {
|
||||
label: 'Eval FPS',
|
||||
value: eval_fps,
|
||||
disabled: true,
|
||||
},
|
||||
train_eta: {
|
||||
label: 'Train ETA',
|
||||
value: train_eta,
|
||||
disabled: true,
|
||||
},
|
||||
}),
|
||||
[
|
||||
isWebsocketConnected,
|
||||
isWebrtcConnected,
|
||||
eval_fps,
|
||||
train_eta,
|
||||
],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setControls({ min_resolution });
|
||||
setControls({ max_resolution });
|
||||
@@ -238,8 +264,6 @@ export function RenderControls() {
|
||||
setControls({ 'Camera FoV': field_of_view });
|
||||
}, [
|
||||
setControls,
|
||||
isWebsocketConnected,
|
||||
isWebrtcConnected,
|
||||
isTraining,
|
||||
outputOptions,
|
||||
outputChoice,
|
||||
@@ -248,5 +272,28 @@ export function RenderControls() {
|
||||
field_of_view,
|
||||
]);
|
||||
|
||||
useEffect(() => {}, [
|
||||
setState,
|
||||
isWebsocketConnected,
|
||||
isWebrtcConnected,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
websocket.addEventListener('message', (originalCmd) => {
|
||||
// set the remote description when the offer is received
|
||||
const cmd = msgpack.decode(new Uint8Array(originalCmd.data));
|
||||
if (cmd.path === '/renderingState/eval_fps') {
|
||||
eval_fps = cmd.data;
|
||||
console.log("setting state", eval_fps);
|
||||
setState({ eval_fps });
|
||||
}
|
||||
if (cmd.path === '/renderingState/train_eta') {
|
||||
train_eta = cmd.data;
|
||||
console.log("setting state", train_eta)
|
||||
setState({ train_eta });
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user