MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / draw_points

Function draw_points

tutorials/motr/eval.py:120–126  ·  view source on GitHub ↗
(img: np.ndarray, points: np.ndarray, color=(255, 255, 255))

Source from the content-addressed store, hash-verified

118
119
120def 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
129def tensor_to_numpy(tensor: torch.Tensor) -> np.ndarray:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected