From 2dfa2630fea6a5300203f24d9b03d90a0ce3fd01 Mon Sep 17 00:00:00 2001 From: zrezke Date: Wed, 26 Jul 2023 15:13:40 +0200 Subject: [PATCH] all lints including examples --- examples/python/colmap/main.py | 2 +- examples/python/segment_anything/main.py | 2 +- examples/python/tracking_hf_opencv/main.py | 4 ++-- rerun_py/tests/unit/test_color_conversion.py | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/python/colmap/main.py b/examples/python/colmap/main.py index d9512afe5681..0a146bb048fe 100755 --- a/examples/python/colmap/main.py +++ b/examples/python/colmap/main.py @@ -163,7 +163,7 @@ def read_and_log_sparse_reconstruction( img = cv2.resize(img, resize) jpeg_quality = [int(cv2.IMWRITE_JPEG_QUALITY), 75] _, encimg = cv2.imencode(".jpg", img, jpeg_quality) - viewer.log_image_file("camera/image", img_bytes=encimg) + viewer.log_image_file("camera/image", img_bytes=encimg) # type: ignore[arg-type] else: viewer.log_image_file("camera/image", img_path=dataset_path / "images" / image.name) diff --git a/examples/python/segment_anything/main.py b/examples/python/segment_anything/main.py index dfc33b9a315e..7d40a75d4ee9 100755 --- a/examples/python/segment_anything/main.py +++ b/examples/python/segment_anything/main.py @@ -149,7 +149,7 @@ def load_image(image_uri: str) -> Mat: image = cv2.imread(image_uri, cv2.IMREAD_COLOR) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) - return image + return image # type: ignore[no-any-return] def main() -> None: diff --git a/examples/python/tracking_hf_opencv/main.py b/examples/python/tracking_hf_opencv/main.py index df2be51e9dbd..11401da35594 100755 --- a/examples/python/tracking_hf_opencv/main.py +++ b/examples/python/tracking_hf_opencv/main.py @@ -159,7 +159,7 @@ def __init__(self, tracking_id: int, detection: Detection, bgr: npt.NDArray[np.u self.tracked = detection.scaled_to_fit_image(bgr) self.num_recent_undetected_frames = 0 - self.tracker = cv.TrackerCSRT_create() + self.tracker = cv.TrackerCSRT_create() # type: ignore[attr-defined] bbox_xywh_rounded = [int(val) for val in self.tracked.bbox_xywh] self.tracker.init(bgr, bbox_xywh_rounded) self.log_tracked() @@ -199,7 +199,7 @@ def log_tracked(self) -> None: def update_with_detection(self, detection: Detection, bgr: npt.NDArray[np.uint8]) -> None: self.num_recent_undetected_frames = 0 self.tracked = detection.scaled_to_fit_image(bgr) - self.tracker = cv.TrackerCSRT_create() + self.tracker = cv.TrackerCSRT_create() # type: ignore[attr-defined] bbox_xywh_rounded = [int(val) for val in self.tracked.bbox_xywh] self.tracker.init(bgr, bbox_xywh_rounded) self.log_tracked() diff --git a/rerun_py/tests/unit/test_color_conversion.py b/rerun_py/tests/unit/test_color_conversion.py index b1bdde669854..43d2f06b3ae4 100644 --- a/rerun_py/tests/unit/test_color_conversion.py +++ b/rerun_py/tests/unit/test_color_conversion.py @@ -1,6 +1,5 @@ """Test for color_conversion module.""" import numpy as np - from depthai_viewer.color_conversion import ( linear_to_gamma_u8_pixel, linear_to_gamma_u8_value,