def update_tracks(self, managed_tracks):
    """Updates tracks stored in the validator with new tracking data.

    Also adds new tracks if the validator does not know about the track yet.

    Args:
      managed_tracks: Tracks managed by mediapipe.
    """
    for track in managed_tracks:
      if track.track_id in self._track_map:
        registered_track = self._track_map[track.track_id]
        registered_track.track = track
      else:
        new_track = TrackWrapper(
            track=track,
            age=0,
            staleness=0,
        )
        self._track_map[track.track_id] = new_track