diff --git a/rerun_py/depthai_viewer/_backend/device.py b/rerun_py/depthai_viewer/_backend/device.py index b43064f048c9..fdc8c3f3bc78 100644 --- a/rerun_py/depthai_viewer/_backend/device.py +++ b/rerun_py/depthai_viewer/_backend/device.py @@ -6,13 +6,11 @@ from typing import Dict, List, Optional, Tuple import depthai as dai -import numpy as np from depthai_sdk import OakCamera from depthai_sdk.classes.packet_handlers import ComponentOutput from depthai_sdk.components import CameraComponent, NNComponent, StereoComponent from depthai_sdk.components.camera_helper import getClosestIspScale from depthai_sdk.components.tof_component import Component, ToFComponent -from numpy.typing import NDArray import depthai_viewer as viewer from depthai_viewer._backend.device_configuration import ( @@ -115,7 +113,6 @@ def set_oak(self, oak_cam: Optional[OakCamera]) -> None: def is_closed(self) -> bool: return self._oak is not None and self._oak.device.isClosed() - def _get_possible_stereo_pairs_for_cam( self, cam: dai.CameraFeatures, connected_camera_features: List[dai.CameraFeatures] ) -> List[dai.CameraBoardSocket]: diff --git a/rerun_py/depthai_viewer/_backend/packet_handler.py b/rerun_py/depthai_viewer/_backend/packet_handler.py index 989796375276..fb9cd684f18c 100644 --- a/rerun_py/depthai_viewer/_backend/packet_handler.py +++ b/rerun_py/depthai_viewer/_backend/packet_handler.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Optional, Tuple, Union +from typing import Dict, List, Optional, Tuple, Union import cv2 import depthai as dai @@ -29,7 +29,6 @@ from depthai_viewer._backend.store import Store from depthai_viewer._backend.topic import Topic from depthai_viewer.components.rect2d import RectFormat -from typing import Dict class PacketHandlerContext(BaseModel): # type: ignore[misc] @@ -183,7 +182,9 @@ def _log_img_frame( ) -> None: """ Log an image frame to the viewer. - Optionally undistort and rectify the image using the provided intrinsic matrix and distortion coefficients. + + Optionally undistort and rectify the image using the provided intrinsic matrix + and distortion coefficients. """ viewer.log_rigid3( f"{board_socket.name}/transform", child_from_parent=([0, 0, 0], [1, 0, 0, 0]), xyz="RDF" @@ -208,8 +209,10 @@ def _log_img_frame( child_from_parent: NDArray[np.float32] try: - child_from_parent = self._calibration_handler.get_intrinsic_matrix( # type: ignore[call-arg, misc, arg-type] - board_socket, w, h # type: ignore[call-arg, misc, arg-type] + child_from_parent = ( + self._calibration_handler.get_intrinsic_matrix( # type: ignore[call-arg, misc, arg-type] + board_socket, w, h # type: ignore[call-arg, misc, arg-type] + ) ) except Exception: f_len = (w * h) ** 0.5