diff --git a/rerun_py/depthai_viewer/_backend/device.py b/rerun_py/depthai_viewer/_backend/device.py index 729da9c55ab2..c6e1fead6ae7 100644 --- a/rerun_py/depthai_viewer/_backend/device.py +++ b/rerun_py/depthai_viewer/_backend/device.py @@ -6,15 +6,13 @@ from typing import Dict, List, Optional, Tuple import depthai as dai +import depthai_viewer as viewer 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 ( ALL_NEURAL_NETWORKS, CameraConfiguration, @@ -52,6 +50,7 @@ ) from depthai_viewer._backend.store import Store from depthai_viewer.install_requirements import model_dir +from numpy.typing import NDArray class XlinkStatistics: diff --git a/rerun_py/depthai_viewer/_backend/device_configuration.py b/rerun_py/depthai_viewer/_backend/device_configuration.py index 0982454ef3db..4af9b53e1c76 100644 --- a/rerun_py/depthai_viewer/_backend/device_configuration.py +++ b/rerun_py/depthai_viewer/_backend/device_configuration.py @@ -56,9 +56,7 @@ def to_runtime_controls(self) -> Dict[str, Any]: "align": ( "RECTIFIED_LEFT" if self.align == dai.CameraBoardSocket.LEFT - else "RECTIFIED_RIGHT" - if self.align == dai.CameraBoardSocket.RIGHT - else "CENTER" + else "RECTIFIED_RIGHT" if self.align == dai.CameraBoardSocket.RIGHT else "CENTER" ), "lr_check": self.lr_check, "lrc_check_threshold": self.lrc_threshold, @@ -334,9 +332,9 @@ class DeviceProperties(BaseModel): # type: ignore[misc] id: str cameras: List[CameraFeatures] = [] imu: Optional[ImuKind] - stereo_pairs: List[ - Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket] - ] = [] # Which cameras can be paired for stereo + stereo_pairs: List[Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket]] = ( + [] + ) # Which cameras can be paired for stereo default_stereo_pair: Optional[Tuple[dai.CameraBoardSocket, dai.CameraBoardSocket]] = None info: DeviceInfo = DeviceInfo() diff --git a/rerun_py/depthai_viewer/_backend/packet_handler.py b/rerun_py/depthai_viewer/_backend/packet_handler.py index c8957ee05d43..232969f64e67 100644 --- a/rerun_py/depthai_viewer/_backend/packet_handler.py +++ b/rerun_py/depthai_viewer/_backend/packet_handler.py @@ -2,6 +2,7 @@ import cv2 import depthai as dai +import depthai_viewer as viewer import numpy as np from ahrs.filters import Mahony from depthai_sdk.classes.packets import ( # PointcloudPacket, @@ -22,13 +23,10 @@ StereoComponent, ) from depthai_sdk.components.tof_component import ToFComponent -from numpy.typing import NDArray -from pydantic import BaseModel - -import depthai_viewer as viewer from depthai_viewer._backend.store import Store from depthai_viewer._backend.topic import Topic from depthai_viewer.components.rect2d import RectFormat +from numpy.typing import NDArray class PacketHandlerContext(BaseModel): # type: ignore[misc]