Update visualizer.py
Browse files- visualizer.py +8 -2
visualizer.py
CHANGED
@@ -255,7 +255,7 @@ class Visualizer:
|
|
255 |
curr_tracks = curr_tracks[:, segm_mask > 0]
|
256 |
curr_colors = curr_colors[:, segm_mask > 0]
|
257 |
|
258 |
-
res_video[t] = self.
|
259 |
res_video[t],
|
260 |
curr_tracks,
|
261 |
curr_colors,
|
@@ -331,12 +331,18 @@ class Visualizer:
|
|
331 |
self,
|
332 |
rgb: np.ndarray, # H x W x 3,
|
333 |
gt_tracks: np.ndarray, # T x 2
|
|
|
334 |
):
|
335 |
T, N, _ = gt_tracks.shape
|
336 |
-
|
|
|
337 |
rgb = Image.fromarray(np.uint8(rgb))
|
338 |
for t in range(T):
|
|
|
|
|
339 |
for i in range(N):
|
|
|
|
|
340 |
gt_tracks = gt_tracks[t][i]
|
341 |
# draw a red cross
|
342 |
if gt_tracks[0] > 0 and gt_tracks[1] > 0:
|
|
|
255 |
curr_tracks = curr_tracks[:, segm_mask > 0]
|
256 |
curr_colors = curr_colors[:, segm_mask > 0]
|
257 |
|
258 |
+
res_video[t] = self._draw_gt_tracks(
|
259 |
res_video[t],
|
260 |
curr_tracks,
|
261 |
curr_colors,
|
|
|
331 |
self,
|
332 |
rgb: np.ndarray, # H x W x 3,
|
333 |
gt_tracks: np.ndarray, # T x 2
|
334 |
+
vector_colors: np.ndarray = None,
|
335 |
):
|
336 |
T, N, _ = gt_tracks.shape
|
337 |
+
if vector_colors is None:
|
338 |
+
color = np.array((211, 0, 0))
|
339 |
rgb = Image.fromarray(np.uint8(rgb))
|
340 |
for t in range(T):
|
341 |
+
if vector_colors is not None:
|
342 |
+
vector_color = vector_colors[t]
|
343 |
for i in range(N):
|
344 |
+
if vector_colors is not None:
|
345 |
+
color = vector_color[i].astype(int)
|
346 |
gt_tracks = gt_tracks[t][i]
|
347 |
# draw a red cross
|
348 |
if gt_tracks[0] > 0 and gt_tracks[1] > 0:
|