Files
breakpilot-lehrer/klausur-service/backend/ocr/pipeline/overlays.py
Benjamin Admin 0504d22b8e
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 29s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m25s
CI / test-python-agent-core (push) Successful in 19s
CI / test-nodejs-website (push) Successful in 20s
Restructure: Move ocr_pipeline + labeling + crop into ocr/ package
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-25 21:51:43 +02:00

35 lines
1.1 KiB
Python

"""
Overlay image rendering for OCR pipeline — barrel re-export.
All implementation split into:
ocr_pipeline_overlay_structure — structure overlay (boxes, zones, colors, graphics)
ocr_pipeline_overlay_grid — columns, rows, words overlays
Lizenz: Apache 2.0
DATENSCHUTZ: Alle Verarbeitung erfolgt lokal.
"""
from fastapi import HTTPException
from fastapi.responses import Response
from .overlay_structure import _get_structure_overlay # noqa: F401
from .overlay_grid import ( # noqa: F401
_get_columns_overlay,
_get_rows_overlay,
_get_words_overlay,
)
async def render_overlay(overlay_type: str, session_id: str) -> Response:
"""Dispatch to the appropriate overlay renderer."""
if overlay_type == "structure":
return await _get_structure_overlay(session_id)
elif overlay_type == "columns":
return await _get_columns_overlay(session_id)
elif overlay_type == "rows":
return await _get_rows_overlay(session_id)
elif overlay_type == "words":
return await _get_words_overlay(session_id)
else:
raise HTTPException(status_code=400, detail=f"Unknown overlay type: {overlay_type}")