From 83cbd93d3bbe7f8123972706fc93ed1894be510f Mon Sep 17 00:00:00 2001 From: Hoang Bui <47828508+bongbui321@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:22:25 -0400 Subject: [PATCH] tools/rerun: new image API for rerun 0.18 (#33186) * change api for video * install prerelease 0.18 old-commit-hash: 5909bcde62d0a007669098ad9f650cf67c09f174 --- tools/install_python_dependencies.sh | 3 +++ tools/rerun/run.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/install_python_dependencies.sh b/tools/install_python_dependencies.sh index 8d118525a5..2783f7282a 100755 --- a/tools/install_python_dependencies.sh +++ b/tools/install_python_dependencies.sh @@ -37,6 +37,9 @@ echo "installing python packages..." uv --no-cache sync --frozen --all-extras source .venv/bin/activate +# TODO: remove this. Workaround till get a new release. PEP508 doesn't seem to have find-links option +uv pip install --pre -f https://build.rerun.io/commit/a93faab/wheels --upgrade rerun-sdk + echo "PYTHONPATH=${PWD}" > $ROOT/.env if [[ "$(uname)" == 'Darwin' ]]; then echo "# msgq doesn't work on mac" >> $ROOT/.env diff --git a/tools/rerun/run.py b/tools/rerun/run.py index 955aa2707f..79055b6b7d 100755 --- a/tools/rerun/run.py +++ b/tools/rerun/run.py @@ -127,10 +127,9 @@ class Rerunner: rr.init(RR_WIN) rr.connect(default_blueprint=blueprint) - size_hint = (h, w) for ts, frame in fr: rr.set_time_nanos(RR_TIMELINE_NAME, int(ts * 1e9)) - rr.log(cam_type, rr.ImageEncoded(contents=frame,format=rr.ImageFormat.NV12(size_hint))) + rr.log(cam_type, rr.Image(bytes=frame, width=w, height=h, pixel_format=rr.PixelFormat.NV12)) def load_data(self): self._start_rerun()