  from selfdrive.test.process_replay.test_processes import format_diff
  from selfdrive.version import get_git_commit
  
  TEST_ROUTE = "99c94dc769b5d96e|2019-08-03--14-19-59"
  
  def replace_calib(msg, calib):
    msg = msg.as_builder()
    if calib is not None:
 
</s> remove def camera_replay(lr, fr):
 </s> add def replace_calib(msg, calib):
  msg = msg.as_builder()
  if calib is not None:
    msg.liveCalibration.extrinsicMatrix = get_view_frame_from_road_frame(*calib, 1.22).flatten().tolist()
  return msg

def camera_replay(lr, fr, desire=None, calib=None): </s> remove from common.spinner import Spinner
 </s> add from cereal import log </s> remove       if msg.which() == "liveCalibrationd":
        pm.send(msg.which(), msg.as_builder())
 </s> add       if msg.which() == "liveCalibration":
        pm.send(msg.which(), replace_calib(msg, calib))
from common.transformations.camera import get_view_frame_from_road_frame
  from selfdrive.test.process_replay.test_processes import format_diff
  from selfdrive.version import get_git_commit
from common.transformations.camera import get_view_frame_from_road_frame
  
  TEST_ROUTE = "99c94dc769b5d96e|2019-08-03--14-19-59"
  
  def replace_calib(msg, calib):
    msg = msg.as_builder()
    if calib is not None:
keep add keep keep keep keep keep keep
 Added model_replay and fixed some bugs in camera_replay (#2679)

* Added model_replay and fixed some bugs in camera_replay

* Unpack capnp logs on device

* add sync to device

* GPU now also works on PC

* update model ref

* update refs

* dont change this one

* Use pipeline calib instead of rlog calib

* remove that

* update refs

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/test/process_replay/camera_replay.py