forked from gsgen3d/gsgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvis.py
31 lines (25 loc) · 797 Bytes
/
vis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import time
import torch
from gs.gaussian_splatting import GaussianSplattingRenderer
from utils.viewer.viser_viewer import ViserViewer
from omegaconf import OmegaConf
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("ckpt", type=str)
parser.add_argument("--port", type=int, default=8080)
torch.set_default_device("cuda")
opt = parser.parse_args()
renderer = GaussianSplattingRenderer.load(None, opt.ckpt).to("cuda")
renderer.eval()
viewer_cfg = OmegaConf.create(
{
"device": "cuda",
"viewer_port": opt.port,
}
)
viewer = ViserViewer(viewer_cfg, train_mode=False)
viewer.set_renderer(renderer)
while True:
viewer.update()
time.sleep(1e-3)