diff --git a/selfdrive/ui/tests/test_ui/run.py b/selfdrive/ui/tests/test_ui/run.py index c830680aa6..74d090c7e1 100755 --- a/selfdrive/ui/tests/test_ui/run.py +++ b/selfdrive/ui/tests/test_ui/run.py @@ -275,7 +275,7 @@ def create_screenshots(): cam = DEVICE_CAMERAS[("tici", "ar0231")] frames_cache = f'{DEFAULT_CACHE_DIR}/ui_frames' - if os.path.isfile(frames_cache): + if os.path.isfile(frames_cache) and False: with open(frames_cache, 'rb') as f: frames = pickle.load(f) road_img = frames[0] @@ -287,6 +287,7 @@ def create_screenshots(): wide_road_img = FrameReader(route.ecamera_paths()[segnum]).get(0, pix_fmt="nv12")[0] driver_img = FrameReader(route.dcamera_paths()[segnum]).get(0, pix_fmt="nv12")[0] pickle.dump([road_img, wide_road_img, driver_img], f) + raise Exception STREAMS.append((VisionStreamType.VISION_STREAM_ROAD, cam.fcam, road_img.flatten().tobytes())) STREAMS.append((VisionStreamType.VISION_STREAM_WIDE_ROAD, cam.ecam, wide_road_img.flatten().tobytes())) diff --git a/tools/lib/framereader.py b/tools/lib/framereader.py index af23d4aa99..3491c9dfaa 100644 --- a/tools/lib/framereader.py +++ b/tools/lib/framereader.py @@ -420,6 +420,8 @@ class StreamGOPReader(GOPReader): if num < self.first_iframe: skip_frames = self.num_prefix_frames + print('frame_b', frame_b, 'num_frames', num_frames, 'skip_frames', skip_frames, 'rawdat', len(rawdat)) + return frame_b, num_frames, skip_frames, rawdat @@ -489,6 +491,7 @@ class GOPFrameReader(BaseFrameReader): frame_b, num_frames, skip_frames, rawdat = self.get_gop(num) print('skip_frames', skip_frames) + ret = decompress_video_data(rawdat, self.vid_fmt, self.w, self.h, pix_fmt) print('ret.shape', ret.shape) ret = ret[skip_frames:]