Documenting viewer and faster image sending (#86)

* updated three.js version. only send camera information when it moves

* changing code back to updating camera constantly because packets seem to be lost

* name change

* starting viewer docs

* new workflow

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* ga

* homepage

* homepage

* / to ?

* more documentation

* fixed none error

* instant ngp fix

* faster image sending over tcp. instant ngp bin fix. lowest res when moving

* black

* requirements
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-07-07 00:03:45 -07:00
1 parent d0f0f8da2d
commit 44c5e3264c
28 files changed
+28943 -609

No files matched your search

+3 -1
View File
@@ -18,6 +18,7 @@ The Graph module contains all trainable parameters.
from abc import abstractmethod
from collections import defaultdict
import time
import traceback
from typing import Any, Dict, List, Union
import torch
@@ -33,7 +34,7 @@ from pyrad.graphs.modules.ray_generator import RayGenerator
from pyrad.utils import profiler
from pyrad.utils.config import GraphConfig
from pyrad.utils.misc import get_masked_dict, instantiate_from_dict_config, is_not_none
from pyrad.viewer.backend.vis_utils import CameraChangeException
from pyrad.viewer.server.vis_utils import CameraChangeException
@profiler.time_function
@@ -197,6 +198,7 @@ class Graph(AbstractGraph):
self.vis_outputs = outputs
return outputs
except CameraChangeException:
print(traceback.format_exc())
return None
def get_outputs_for_camera(self, camera: Camera):
+3 -3
View File
@@ -104,10 +104,10 @@ class NGPGraph(Graph):
# Hacky treatment of bins as points to allow us to merge uniform and pdf.
ts_uniform = (ray_samples_uniform.bin_starts + ray_samples_uniform.bin_ends) / 2.0
ts_pdf = (ray_samples_pdf.bin_starts + ray_samples_pdf.bin_ends) / 2.0
ts, indices = torch.sort(torch.cat([ts_uniform, ts_pdf], -1), -1)
ts, indices = torch.sort(torch.cat([ts_uniform, ts_pdf], -2), -2)
bin_starts = ts
bin_ends = torch.cat([ts[..., 1:], ts[..., -1:]], dim=-1)
ray_samples = ray_bundle.get_ray_samples(bin_starts=bin_starts, bin_ends=bin_ends)
bin_ends = torch.cat([ts[..., 1:, :], ts[..., -1:, :]], dim=-2)
ray_samples = ray_bundle.get_ray_samples(bin_starts=bin_starts[..., 0], bin_ends=bin_ends[..., 0])
field_outputs = {}
for fo_name, _ in field_outputs_pdf.items():