Skip to content

Commit

Permalink
pylints
Browse files Browse the repository at this point in the history
  • Loading branch information
zrezke committed Jun 9, 2024
1 parent ffbe508 commit 278660c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rerun_py/depthai_viewer/_backend/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def update_pipeline(self, runtime_only: bool) -> Message:
cam_cfg.tof_align = dai.CameraBoardSocket.CAM_B # OAK-D-SR-PoE default.
tof_align = list(
filter(
lambda comp_and_q: (
lambda comp_and_q: ( # type: ignore[arg-type]
comp_and_q[0].node.getBoardSocket() == cam_cfg.tof_align
if isinstance(comp_and_q[0], CameraComponent)
else False
Expand Down
10 changes: 4 additions & 6 deletions rerun_py/depthai_viewer/_backend/packet_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ def _log_img_frame(self, frame: dai.ImgFrame, board_socket: dai.CameraBoardSocke
entity_path = f"{board_socket.name}/transform/{cam}/Image"

if frame.getType() == dai.RawImgFrame.Type.NV12: # or frame.getType() == dai.RawImgFrame.Type.YUV420p
encoding = (
viewer.ImageEncoding.NV12
if frame.getType() == dai.RawImgFrame.Type.NV12
else viewer.ImageEncoding.Yuv420p
)
encoding = viewer.ImageEncoding.NV12
viewer.log_encoded_image(
entity_path,
img_frame,
Expand All @@ -201,7 +197,9 @@ def _log_img_frame(self, frame: dai.ImgFrame, board_socket: dai.CameraBoardSocke
viewer.log_image(entity_path, img_frame)

def _on_camera_frame(self, packet: FramePacket, board_socket: dai.CameraBoardSocket) -> None:
if board_socket in list(map(lambda cam: cam.tof_align, self.store.pipeline_config.cameras)):
if board_socket in list(
map(lambda cam: cam.tof_align, self.store.pipeline_config.cameras if self.store.pipeline_config else [])
):
# Skip tof aligned frames - they will be logged on_tof_packet
return
self._log_img_frame(packet.msg, board_socket)
Expand Down

0 comments on commit 278660c

Please sign in to comment.