Skip to content

Commit 20e311c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 85d1f56 commit 20e311c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

colour_checker_detection/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
try:
7373
_version = (
74-
subprocess.check_output( # noqa: S603
74+
subprocess.check_output(
7575
["git", "describe"], # noqa: S607
7676
cwd=os.path.dirname(__file__),
7777
stderr=subprocess.STDOUT,

colour_checker_detection/detection/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def transform_image(
552552
transform += as_float32_array([[0, 0, t_x], [0, 0, t_y]])
553553

554554
return cast(
555-
NDArrayReal,
555+
"NDArrayReal",
556556
cv2.warpAffine(
557557
image,
558558
transform,
@@ -650,14 +650,14 @@ def detect_contours(
650650
iterations=settings.convolution_iterations,
651651
)
652652

653-
image_k = cast(NDArrayReal, image_k)
653+
image_k = cast("NDArrayReal", image_k)
654654

655655
# Detecting contours.
656656
contours, _hierarchy = cv2.findContours(
657657
image_k, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE
658658
)
659659

660-
contours = cast(Tuple[NDArrayInt], contours)
660+
contours = cast("Tuple[NDArrayInt]", contours)
661661

662662
if additional_data:
663663
return contours, image_k
@@ -827,7 +827,7 @@ def approximate_contour(
827827
contour, center * cv2.arcLength(contour, True), True
828828
)
829829

830-
approximation = cast(NDArrayInt, approximation)
830+
approximation = cast("NDArrayInt", approximation)
831831

832832
if len(approximation) > points:
833833
low = (low + high) / 2
@@ -1155,7 +1155,7 @@ def sample_colour_checker(
11551155
colour_checker = colour_checker_candidate
11561156
quadrilateral = candidate_quadrilateral
11571157

1158-
colour_checker = cast(NDArrayFloat, colour_checker)
1158+
colour_checker = cast("NDArrayFloat", colour_checker)
11591159

11601160
return DataDetectionColourChecker(
11611161
sampled_colours, masks, colour_checker, quadrilateral

colour_checker_detection/detection/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def detect_colour_checkers_inference(
422422
if apply_cctf_decoding:
423423
image = cctf_decoding(image)
424424

425-
image = cast(NDArrayReal, image)
425+
image = cast("NDArrayReal", image)
426426

427427
rectangle = as_int32_array(
428428
[

colour_checker_detection/detection/segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def detect_colour_checkers_segmentation(
628628
if apply_cctf_decoding:
629629
image = cctf_decoding(image)
630630

631-
image = cast(NDArrayReal, image)
631+
image = cast("NDArrayReal", image)
632632

633633
image = reformat_image(image, settings.working_width, settings.interpolation_method)
634634

utilities/export_todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def extract_todo_items(root_directory: str) -> dict:
8181

8282
if in_todo and line.startswith("#"):
8383
todo_item.append(line.replace("#", "").strip())
84-
elif len(todo_item):
84+
elif todo_item:
8585
key = filename.replace("../", "")
8686
if not todo_items.get(key):
8787
todo_items[key] = []

0 commit comments

Comments
 (0)