def reset_tracks_with_detections(self, detections):
    """Resets the staleness of tracks if there are associated detections.

    Args:
      detections: List of raw detections created from inferencing.
    """
    for detection in detections:
      max_iou = 0
      associated_track = None
      for track in self._track_map.values():
        iou = calculate_iou(detection.bbox, track.track.bbox)
        if iou > max_iou and iou > self._min_iou:
          max_iou = iou
          associated_track = track
      if associated_track is not None:
        associated_track.staleness = 0