mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-22 15:45:39 +08:00
Merge branch 'main' of https://github.com/plenoptix/nerfactory into terrance/dreamembedding
This commit is contained in:
commit
44b9ef5604
59 files changed
+1750
-1014
No files matched your search
@@ -132,9 +132,9 @@ def _start_viewer(config: TrainerConfig, pipeline: Pipeline, step: int):
|
||||
assert viewer_state and pipeline.datamanager.train_dataset
|
||||
viewer_state.init_scene(
|
||||
dataset=pipeline.datamanager.train_dataset,
|
||||
start_train=False,
|
||||
train_state="completed",
|
||||
)
|
||||
viewer_state.viser_server.set_is_training(False)
|
||||
viewer_state.viser_server.set_training_state("completed")
|
||||
viewer_state.update_scene(step=step)
|
||||
while True:
|
||||
time.sleep(0.01)
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
||||
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
|
||||
import tyro
|
||||
from viser.infra import generate_typescript_interfaces
|
||||
|
||||
from nerfstudio.viewer.viser import NerfstudioMessage
|
||||
|
||||
|
||||
def entrypoint() -> None:
|
||||
def main() -> None:
|
||||
"""Generate viser message definitions for TypeScript, by parsing Python dataclasses."""
|
||||
|
||||
# Generate typescript source.
|
||||
@@ -23,13 +24,30 @@ def entrypoint() -> None:
|
||||
"nerfstudio/viewer/app/src/modules/WebSocket/ViserMessages.tsx"
|
||||
)
|
||||
assert target_path.exists()
|
||||
target_path.write_text(defs, encoding="utf_8")
|
||||
print(f"Wrote to {target_path}")
|
||||
|
||||
# Run prettier.
|
||||
# TODO: if this is not installed maybe we should print some error with installation
|
||||
# instructions?
|
||||
subprocess.run(args=["prettier", "-w", str(target_path)], check=False)
|
||||
old_defs = target_path.read_text(encoding="utf_8")
|
||||
|
||||
if old_defs != defs:
|
||||
target_path.write_text(defs, encoding="utf_8")
|
||||
|
||||
with open("nerfstudio/viewer/app/package.json", "r", encoding="utf_8") as f:
|
||||
data = json.load(f)
|
||||
|
||||
now = datetime.now()
|
||||
data["version"] = now.strftime("%y-%m-%d") + "-0"
|
||||
|
||||
with open("nerfstudio/viewer/app/package.json", "w", encoding="utf_8") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
print(f"Wrote updates to {target_path}")
|
||||
print(f"Current viewer version is now {data['version']}")
|
||||
else:
|
||||
print("No update to messages.")
|
||||
|
||||
|
||||
def entrypoint() -> None:
|
||||
"""Entrypoint for use with pyproject scripts."""
|
||||
# All entrypoints must currently be tyro CLIs.
|
||||
tyro.cli(main)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user