ByoTrack ViZ

We add some visualization tools. They rely on matplotlib and opencv-python.

Note

We developed these tools under linux using opencv + gtk backend. It seems that the zoom/drag/quit operations are not automatically supported on other platforms.

byotrack.visualize.display_lifetime(tracks: Collection[Track])

Display the lifetime of tracks

Parameters:

tracks (Collection[byotrack.Track]) – Tracks

class byotrack.visualize.InteractiveVisualizer(video: Sequence[ndarray] | None = None, detections_sequence: Collection[Detections] = (), tracks: Collection[Track] = ())

Bases: object

Interactive visualization with opencv

Keys:
  • space: Pause/Unpause the video

  • w/x: Move backward/forward in the video (when paused)

  • d: Switch detections display mode (Not displayed, Mask, Segmentation) if available

  • t: Switch on/off the display of tracks if available

  • v: Switch on/off the display of the video

video

Optional video to display. Should be normalized in [0, 1] Default: None

Type:

Optional[Sequence[np.ndarray]]

detections_sequence

Optional detections to display Default: () (no detections)

Type:

Collection[byotrack.Detections]

tracks

Optional tracks to display Default: () (no tracks)

Type:

Collection[byotrack.Tracks]

frame_shape

Shape of frames

Type:

Tuple[int, int]

n_frames

Number of frames

Type:

int

run(frame_id=0, fps=20) None

Run the visualization

Parameters:
  • frame_id (int) – Starting frame_id

  • fps (int) – Frame rate

handle_actions(key: int) bool

Handle inputs from user

Return True to quit

Parameters:

key (int) – Key input from user

Returns:

True to quit visualization

Return type:

bool