Skip to content

Commit

Permalink
Merge pull request #930 from luxonis/fix/frame_shape
Browse files Browse the repository at this point in the history
Hotfix (1.9.3.1)
  • Loading branch information
daniilpastukhov authored Feb 6, 2023
2 parents 62eda88 + 26be21e commit e45c50d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion depthai_sdk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='depthai-sdk',
version='1.9.3',
version='1.9.3.1',
description='This package provides an abstraction of the DepthAI API library.',
long_description=io.open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
9 changes: 6 additions & 3 deletions depthai_sdk/src/depthai_sdk/oak_outputs/xout/xout_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ def setup_visualize(self,

def on_callback(self, packet: Union[DetectionPacket, TrackerPacket]):
if self._visualizer and self._visualizer.frame_shape is None:
shape = packet.imgFrame.getFrame().shape
try:
shape = packet.imgFrame.getCvFrame().shape[:2]
except RuntimeError as e:
raise RuntimeError(f'Error getting frame shape - {e}')
if len(shape) == 1:
self._visualizer.frame_shape = self._frame_shape
else:
self._visualizer.frame_shape = shape[1:]
self._frame_shape = shape[1:]
self._visualizer.frame_shape = shape
self._frame_shape = shape

# Add detections to packet
if isinstance(packet.img_detections, dai.ImgDetections) \
Expand Down
4 changes: 2 additions & 2 deletions depthai_sdk/src/depthai_sdk/visualize/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def stereo(self,
def detections(self,
thickness: int = None,
fill_transparency: float = None,
box_roundness: float = None,
bbox_roundness: float = None,
color: Tuple[int, int, int] = None,
bbox_style: BboxStyle = None,
line_width: float = None,
Expand All @@ -299,7 +299,7 @@ def detections(self,
Args:
thickness: Thickness of the bounding box.
fill_transparency: Transparency of the bounding box.
box_roundness: Roundness of the bounding box.
bbox_roundness: Roundness of the bounding box.
color: Color of the bounding box.
bbox_style: Style of the bounding box.
line_width: Width of the bbox horizontal lines CORNERS or ROUNDED_CORNERS style is used.
Expand Down

0 comments on commit e45c50d

Please sign in to comment.