(img: np.ndarray, points: np.ndarray, color=(255, 255, 255))
| 118 | |
| 119 | |
| 120 | def draw_points(img: np.ndarray, points: np.ndarray, color=(255, 255, 255)) -> np.ndarray: |
| 121 | assert len(points.shape) == 2 and points.shape[1] == 2, 'invalid points shape: {}'.format(points.shape) |
| 122 | for i, (x, y) in enumerate(points): |
| 123 | if i >= 300: |
| 124 | color = (0, 255, 0) |
| 125 | cv2.circle(img, (int(x), int(y)), 2, color=color, thickness=2) |
| 126 | return img |
| 127 | |
| 128 | |
| 129 | def tensor_to_numpy(tensor: torch.Tensor) -> np.ndarray: |
nothing calls this directly
no outgoing calls
no test coverage detected