MCPcopy Create free account
hub / github.com/CUT3R/CUT3R / parse_pc_data

Method parse_pc_data

viser_utils.py:622–645  ·  view source on GitHub ↗
(
        self,
        pc,
        color,
        conf=None,
        edge_color=[0.251, 0.702, 0.902],
        set_border_color=False,
    )

Source from the content-addressed store, hash-verified

620 return pcs, step_list
621
622 def parse_pc_data(
623 self,
624 pc,
625 color,
626 conf=None,
627 edge_color=[0.251, 0.702, 0.902],
628 set_border_color=False,
629 ):
630
631 pred_pts = pc.reshape(-1, 3) # [N, 3]
632
633 if set_border_color and edge_color is not None:
634 color = self.set_color_border(color[0], color=edge_color)
635 if np.isnan(color).any():
636
637 color = np.zeros((pred_pts.shape[0], 3))
638 color[:, 2] = 1
639 else:
640 color = color.reshape(-1, 3)
641 if conf is not None:
642 conf = conf[0].reshape(-1)
643 pred_pts = pred_pts[conf > self.vis_threshold]
644 color = color[conf > self.vis_threshold]
645 return pred_pts, color
646
647 def add_pc(self, step):
648 pc = self.pcs[step]["pc"]

Callers 2

_Method · 0.95
add_pcMethod · 0.95

Calls 1

set_color_borderMethod · 0.95

Tested by

no test coverage detected