Skip to content

Commit

Permalink
Proper save implementation
Browse files Browse the repository at this point in the history
Currently requires a development version of april_vision
  • Loading branch information
WillB97 committed Jun 30, 2024
1 parent df747d5 commit 9c47528
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"pyserial >=3,<4",
"april_vision >=2.0.2,<3",
"april_visio@git+https://github.com/WillB97/april_vision#egg=save-functionality",
"typing-extensions; python_version<'3.10'",
]
classifiers = [
Expand Down
7 changes: 2 additions & 5 deletions sbot/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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(
Expand Down

0 comments on commit 9c47528

Please sign in to comment.