(
self,
pc,
color,
conf=None,
edge_color=[0.251, 0.702, 0.902],
set_border_color=False,
downsample_factor=1,
)
| 778 | return pcs, step_list |
| 779 | |
| 780 | def parse_pc_data( |
| 781 | self, |
| 782 | pc, |
| 783 | color, |
| 784 | conf=None, |
| 785 | edge_color=[0.251, 0.702, 0.902], |
| 786 | set_border_color=False, |
| 787 | downsample_factor=1, |
| 788 | ): |
| 789 | |
| 790 | pred_pts = pc.reshape(-1, 3) # [N, 3] |
| 791 | |
| 792 | if set_border_color and edge_color is not None: |
| 793 | color = self.set_color_border(color[0], color=edge_color) |
| 794 | if np.isnan(color).any(): |
| 795 | |
| 796 | color = np.zeros((pred_pts.shape[0], 3)) |
| 797 | color[:, 2] = 1 |
| 798 | else: |
| 799 | color = color.reshape(-1, 3) |
| 800 | if conf is not None: |
| 801 | conf = conf[0].reshape(-1) |
| 802 | pred_pts = pred_pts[conf > self.vis_threshold] |
| 803 | color = color[conf > self.vis_threshold] |
| 804 | |
| 805 | # apply downsample |
| 806 | if downsample_factor > 1 and len(pred_pts) > 0: |
| 807 | indices = np.arange(0, len(pred_pts), downsample_factor) |
| 808 | pred_pts = pred_pts[indices] |
| 809 | color = color[indices] |
| 810 | |
| 811 | return pred_pts, color |
| 812 | |
| 813 | def add_pc(self, step): |
| 814 | pc = self.pcs[step]["pc"] |
no test coverage detected