Skip to content

Commit

Permalink
Merge pull request #1025 from luxonis/fix-nnet-callbacks
Browse files Browse the repository at this point in the history
Check if visualizer is enabled before trying to set frame_shape
  • Loading branch information
zrezke authored May 18, 2023
2 parents 153de22 + f7e467c commit 7c9f989
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion depthai_sdk/src/depthai_sdk/oak_outputs/xout/xout_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def on_callback(self, packet: Union[DetectionPacket, TrackerPacket]):
if self._frame_shape is None:
# Lazy-load the frame shape
self._frame_shape = np.array([packet.frame.shape[0], packet.frame.shape[1]])
self._visualizer.frame_shape = self._frame_shape
if self._visualizer:
self._visualizer.frame_shape = self._frame_shape

bbox = BoundingBox().resize_to_aspect_ratio(packet.frame.shape, self._nn_size, self._resize_mode)

Expand Down

0 comments on commit 7c9f989

Please sign in to comment.