MCPcopy Create free account
hub / github.com/Inception3D/TTT3R / __init__

Method __init__

viser_utils.py:326–580  ·  view source on GitHub ↗
(
        self,
        model,
        state_args,
        pc_list,
        color_list,
        conf_list,
        cam_dict,
        image_mask=None,
        edge_color_list=None,
        device="cpu",
        port=8080,
        show_camera=True,
        vis_threshold=1,
        size=512,
        downsample_factor=10,
    )

Source from the content-addressed store, hash-verified

324
325class PointCloudViewer:
326 def __init__(
327 self,
328 model,
329 state_args,
330 pc_list,
331 color_list,
332 conf_list,
333 cam_dict,
334 image_mask=None,
335 edge_color_list=None,
336 device="cpu",
337 port=8080,
338 show_camera=True,
339 vis_threshold=1,
340 size=512,
341 downsample_factor=10,
342 ):
343 self.model = model
344 self.size=size
345 self.state_args = state_args
346 self.server = viser.ViserServer(port=port)
347 self.server.set_up_direction("-y")
348 self.device = device
349 self.conf_list = conf_list
350 self.vis_threshold = vis_threshold
351 self.tt = lambda x: torch.from_numpy(x).float().to(device)
352 self.pcs, self.all_steps = self.read_data(
353 pc_list, color_list, conf_list, edge_color_list
354 )
355 self.cam_dict = cam_dict
356 self.num_frames = len(self.all_steps)
357 self.image_mask = image_mask
358 self.show_camera = show_camera
359 self.on_replay = False
360 self.vis_pts_list = []
361 self.traj_list = []
362 self.orig_img_list = [x[0] for x in color_list]
363 self.via_points = []
364
365 gui_reset_up = self.server.gui.add_button(
366 "Reset up direction",
367 hint="Set the camera control 'up' direction to the current camera's 'up'.",
368 )
369
370 @gui_reset_up.on_click
371 def _(event: viser.GuiEvent) -> None:
372 client = event.client
373 assert client is not None
374 client.camera.up_direction = tf.SO3(client.camera.wxyz) @ np.array(
375 [0.0, -1.0, 0.0]
376 )
377
378 button3 = self.server.gui.add_button("4D (Only Show Current Frame)")
379 button4 = self.server.gui.add_button("3D (Show All Frames)")
380 self.is_render = False
381 self.fourd = False
382
383 @button3.on_click

Callers

nothing calls this directly

Calls 1

read_dataMethod · 0.95

Tested by

no test coverage detected