nikkar commited on
Commit
7da67b4
·
verified ·
1 Parent(s): d77d251

Update visualizer.py

Browse files
Files changed (1) hide show
  1. visualizer.py +30 -7
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._draw_gt_tracks(
259
  res_video[t],
260
  curr_tracks,
261
  curr_colors,
@@ -277,13 +277,36 @@ class Visualizer:
277
  if not compensate_for_camera_motion or (
278
  compensate_for_camera_motion and segm_mask[i] > 0
279
  ):
280
- img = draw_circle(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  img,
282
- coord=coord,
283
- radius=int(self.linewidth * 2),
284
- color=vector_colors[t, i].astype(int),
285
- visible=visibile,
286
- color_alpha=color_alpha,
 
 
 
 
 
 
 
 
287
  )
288
  res_video[t] = np.array(img)
289
 
 
255
  curr_tracks = curr_tracks[:, segm_mask > 0]
256
  curr_colors = curr_colors[:, segm_mask > 0]
257
 
258
+ res_video[t] = self._draw_pred_tracks(
259
  res_video[t],
260
  curr_tracks,
261
  curr_colors,
 
277
  if not compensate_for_camera_motion or (
278
  compensate_for_camera_motion and segm_mask[i] > 0
279
  ):
280
+ # img = draw_circle(
281
+ # img,
282
+ # coord=coord,
283
+ # radius=int(self.linewidth * 2),
284
+ # color=vector_colors[t, i].astype(int),
285
+ # visible=visibile,
286
+ # color_alpha=color_alpha,
287
+ # )
288
+
289
+ coord_ = coord[t,i]
290
+ # draw a red cross
291
+ # if gt_tracks[0] > 0 and gt_tracks[1] > 0:
292
+ length = self.linewidth * 3
293
+ coord_y = (int(coord_[0]) + length, int(coord_[1]) + length)
294
+ coord_x = (int(coord_[0]) - length, int(coord_[1]) - length)
295
+ rgb = draw_line(
296
  img,
297
+ coord_y,
298
+ coord_x,
299
+ vector_colors[t, i].astype(int),
300
+ self.linewidth,
301
+ )
302
+ coord_y = (int(coord_[0]) - length, int(coord_[1]) + length)
303
+ coord_x = (int(coord_[0]) + length, int(coord_[1]) - length)
304
+ rgb = draw_line(
305
+ img,
306
+ coord_y,
307
+ coord_x,
308
+ vector_colors[t, i].astype(int),
309
+ self.linewidth,
310
  )
311
  res_video[t] = np.array(img)
312