This commit is contained in:
Justin committed 2023-06-18 05:06:40 +00:00
commit 1182b18b48
4 files changed
+14 -10

No files matched your search

+1 -1
View File
@@ -158,7 +158,7 @@ method_configs["nerfacto-huge"] = TrainerConfig(
mixed_precision=True,
pipeline=VanillaPipelineConfig(
datamanager=VanillaDataManagerConfig(
dataparser=NerfstudioDataParserConfig(downscale_factor=1),
dataparser=NerfstudioDataParserConfig(),
train_num_rays_per_batch=16384,
eval_num_rays_per_batch=4096,
camera_optimizer=CameraOptimizerConfig(
@@ -15,7 +15,6 @@
"""Helper utils for processing data into the nerfstudio format."""
import math
import os
import shutil
import sys
from enum import Enum
@@ -348,11 +347,8 @@ def downscale_images(
assert isinstance(downscale_factor, int)
downscale_dir = image_dir.parent / f"{folder_name}_{downscale_factor}"
downscale_dir.mkdir(parents=True, exist_ok=True)
# Using %05d ffmpeg commands appears to be unreliable (skips images), so use scandir.
files = os.scandir(image_dir)
for f in files:
if f.is_dir():
continue
# Using %05d ffmpeg commands appears to be unreliable (skips images).
for f in list_images(image_dir):
filename = f.name
nn_flag = "" if not nearest_neighbor else ":flags=neighbor"
ffmpeg_cmd = [
@@ -17,6 +17,7 @@ from __future__ import annotations
import contextlib
import threading
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Tuple, get_args
@@ -97,12 +98,16 @@ class RenderStateMachine(threading.Thread):
elif self.next_action == "rerender":
# never overwrite rerenders
pass
elif action.action == "static" and self.next_action.action == "move":
# don't overwrite a move action with a static: static is always self-fired
return
else:
# monimal use case, just set the next action
self.next_action = action
# handle interrupt logic
if self.state == "high" and self.next_action.action in ("move", "rerender"):
print("interrupting render", self.next_action.action)
self.interrupt_render_flag = True
self.render_trigger.set()
@@ -176,7 +181,10 @@ class RenderStateMachine(threading.Thread):
continue
self._send_output_to_viewer(outputs)
# if we rendered a static low res, we need to self-trigger a static high-res
if self.state == "low_static":
if self.next_action is None:
# if there hasn't been an action, wait for 1/target_fps seconds in case we get another move command
time.sleep(1 / self.target_fps)
if self.state in ["low_static", "low_move"]:
self.action(RenderAction("static", action.camera_state))
def check_interrupt(self, frame, event, arg):
+2 -2
View File
@@ -126,8 +126,8 @@ class Viewer:
def _interrupt_render(self, _) -> None:
"""Interrupt current render."""
if self.camera_message is not None:
self.render_statemachine.action(RenderAction("rerender", self.camera_message))
if self.camera_state is not None:
self.render_statemachine.action(RenderAction("rerender", self.camera_state))
def _crop_params_update(self, _) -> None:
"""Update crop parameters"""