(mask, context, open_iteration, kernel)
| 52 | return xs, ys, zs |
| 53 | |
| 54 | def open_small_mask(mask, context, open_iteration, kernel): |
| 55 | np_mask = mask.cpu().data.numpy().squeeze().astype(np.uint8) |
| 56 | raw_mask = np_mask.copy() |
| 57 | np_context = context.cpu().data.numpy().squeeze().astype(np.uint8) |
| 58 | np_input = np_mask + np_context |
| 59 | for _ in range(open_iteration): |
| 60 | np_input = cv2.erode(cv2.dilate(np_input, np.ones((kernel, kernel)), iterations=1), np.ones((kernel,kernel)), iterations=1) |
| 61 | np_mask[(np_input - np_context) > 0] = 1 |
| 62 | out_mask = torch.FloatTensor(np_mask).to(mask)[None, None, ...] |
| 63 | |
| 64 | return out_mask |
| 65 | |
| 66 | def filter_irrelevant_edge_new(self_edge, comp_edge, other_edges, other_edges_with_id, current_edge_id, context, depth, mesh, context_cc, spdb=False): |
| 67 | other_edges = other_edges.squeeze().astype(np.uint8) |
no test coverage detected