chore: remove debug code

This commit is contained in:
iriley 2024-05-15 16:38:51 +02:00
parent b0467f2335
commit 23406004ed
3 changed files with 2 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "cv-analysis-service"
version = "2.16.1"
version = "2.19.0"
description = ""
authors = ["Isaac Riley <isaac.riley@knecon.com>"]
readme = "README.md"

View File

@ -44,11 +44,9 @@ def annotate_page(page: fitz.Page, prediction):
start = itemgetter("x1", "y1")(line)
end = itemgetter("x2", "y2")(line)
bbox = *start, *end
bbox = (*start, *end)
height = page.bound()[3]
logger.info(f"{height=}")
bbox = mirror_horizontal(bbox, page_height=height)
assert bbox == mirror_horizontal(mirror_horizontal(bbox, height), height)
start = tuple(bbox[:2])
end = tuple(bbox[2:])

View File

@ -58,7 +58,6 @@ def mirror_horizontal(bbox: BBoxType, page_height: int | float) -> BBoxType:
x0, y0, x1, y1 = bbox
y0_new = page_height - y0
y1_new = page_height - y1
logger.info(f"Mirrored horizontally: {x0}, {y0} -> {y0_new}, {x1}, {y1} -> {y1_new}; page height: {page_height}")
return x0, y0_new, x1, y1_new
@ -67,7 +66,6 @@ def mirror_vertical(bbox: BBoxType, page_width: int | float) -> BBoxType:
x0, y0, x1, y1 = bbox
x0_new = page_width - x1
x1_new = page_width - x0
logger.info("Mirrored vertically:", x0_new, y0, x1_new, y1)
return x0_new, y0, x1_new, y1