class_docstr: The basic structure of a flow based motion estimator
  To implement your own flow tracker, extend the followting methods:
  
  compuate_flow(): given preprocessed information, compute optical flow map
  prepare_frame(): for preprocessing, the results will be stored and provided to next frame's inference
class_docstr_tok: ["The","basic","structure","of","a","flow","based","motion","estimator","To","implement","your","own","flow","tracker",",","extend","the","followting","methods",":","compuate_flow","(",")",":","given","preprocessed","information",",","compute","optical","flow","map","prepare_frame","(",")",":","for","preprocessing",",","the","results","will","be","stored","and","provided","to","next","frame","'s","inference"]
code: def predict_new_locations(
      self,
      prev_frame_cache: np.ndarray,
      prev_bboxes: np.ndarray,
      new_frame: np.ndarray,
      new_frame_motion_pred_data,
      skip: bool = False,
      **kwargs,
  ):
      t_start_prepare = time.time()
      prepared_new_frame = self.prepare_frame(new_frame)
      assert prev_frame_cache.shape == prepared_new_frame.shape
      e_prepare = time.time() - t_start_prepare
      logging.info(
          "flow preparation runtime: {:.05f}".format(e_prepare)
      )
  
      if not skip:
          t_start_flow = time.time()
          flow_map = self.compute_flow(
              prev_frame_cache, prepared_new_frame
          )
          assert flow_map.shape[-1] == 2, ValueError(
              "flow map elements must be 2 element vectors!"
          )
          e_flow = time.time() - t_start_flow
          logging.info(
              "flow computation runtime: {:.05f}".format(e_flow)
          )
  
          t_start_pred = time.time()
          predicted_bboxes = self._warp_bbox(
              new_frame.shape, prev_bboxes, flow_map
          )
          e_pred = time.time() - t_start_pred
          logging.info(
              "bounding box prediction runtime: {:.05f}".format(e_pred)
          )
          return predicted_bboxes, prepared_new_frame
      else:
          return prev_bboxes, prepared_new_frame
  
imports: import time
  import logging
  from abc import ABC, abstractmethod
  import numpy
label_desc: Use image node_id 2 for calling the BaseFlowMotionEstimator obj's underlying member method code with example usage: obj.predict_new_locations(prev_frame_cache, prev_bboxes, new_frame, new_frame_motion_pred_data, skip) and returns: predicted_bboxes,  prepared_new_frame, prev_bboxes,  prepared_new_frame