mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 18:39:55 +08:00
Fix race condition in viewer (#209)
This commit is contained in:
1 parent
232e497d2f
commit
512842938a
2 files changed
+3
-2
No files matched your search
@@ -208,7 +208,6 @@ class Graph(AbstractGraph):
|
||||
outputs_lists[output_name].append(output)
|
||||
for output_name, outputs_list in outputs_lists.items():
|
||||
outputs[output_name] = torch.cat(outputs_list).view(image_height, image_width, -1)
|
||||
self.vis_outputs = outputs
|
||||
return outputs
|
||||
|
||||
def get_outputs_for_camera(self, camera: Camera):
|
||||
|
||||
@@ -78,6 +78,7 @@ class RenderThread(threading.Thread):
|
||||
self.graph = graph
|
||||
self.camera_ray_bundle = camera_ray_bundle
|
||||
self.exc = None
|
||||
self.vis_outputs = None
|
||||
|
||||
def run(self):
|
||||
"""run function that renders out images given the current graph and ray bundles.
|
||||
@@ -93,6 +94,7 @@ class RenderThread(threading.Thread):
|
||||
|
||||
if outputs:
|
||||
self.graph.process_outputs_as_images(outputs)
|
||||
self.vis_outputs = outputs
|
||||
|
||||
self.state.check_done_render = True
|
||||
self.state.check_interrupt_vis = False
|
||||
@@ -356,7 +358,7 @@ class VisualizerState:
|
||||
pass
|
||||
|
||||
graph.train()
|
||||
outputs = graph.vis_outputs
|
||||
outputs = render_thread.vis_outputs
|
||||
if outputs is not None:
|
||||
self._send_output_to_viewer(outputs)
|
||||
|
||||
|
||||
Reference in new issue
Block a user