From 4a0280bc3c95387645a8ff3180c5f72c02028999 Mon Sep 17 00:00:00 2001 From: WillB97 Date: Sun, 30 Jun 2024 11:40:53 +0100 Subject: [PATCH] Proper save implementation Currently requires a development version of april_vision --- pyproject.toml | 2 +- sbot/camera.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e63e7b1..242e3a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ dynamic = ["version"] requires-python = ">=3.8" dependencies = [ "pyserial >=3,<4", - "april_vision >=2.0.2,<3", + "april_vision@git+https://github.com/WillB97/april_vision.git@save-functionality", "typing-extensions; python_version<'3.10'", ] classifiers = [ diff --git a/sbot/camera.py b/sbot/camera.py index 6b637bb..9496fe8 100644 --- a/sbot/camera.py +++ b/sbot/camera.py @@ -120,9 +120,7 @@ def see( markers = self._cam.see(frame=frame) if save: - # TODO: temporary implementation to be replaced by april_vision==2.2.0 - april_frame = Frame.from_colour_frame(frame) - self._cam._save(frame=april_frame, name=save) + self._cam.save(save, frame=frame, detections=markers) return [Marker.from_april_vision_marker(marker) for marker in markers] def capture(self, *, save: Union[PathLike, None] = None) -> NDArray: @@ -135,8 +133,7 @@ def capture(self, *, save: Union[PathLike, None] = None) -> NDArray: """ raw_frame = self._cam.capture() if save: - # TODO: temporary implementation to be replaced by april_vision==2.2.0 - self._cam.save(name=save, frame=raw_frame) + self._cam.save(save, frame=raw_frame, annotated=False) return raw_frame def _set_marker_sizes(