cv-analysis-service/test/page_generation_test.py
2023-02-15 20:16:16 +01:00

20 lines
487 B
Python

from typing import Iterable
from PIL.Image import Image
from cv_analysis.utils.display import show_image
from cv_analysis.utils.rectangle import Rectangle
def test_blank_page(page_with_content):
page, boxes = page_with_content
draw_boxes(page, boxes)
def draw_boxes(page: Image, boxes: Iterable[Rectangle]):
from cv_analysis.utils.drawing import draw_rectangles
page = draw_rectangles(page, boxes, filled=False, annotate=True)
show_image(page, backend="pil")