fix: Word-Erkennung ohne Spalten ermoeglichen (Full-Page Pseudo-Column)
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 34s
CI / test-go-edu-search (push) Successful in 31s
CI / test-python-klausur (push) Failing after 2m14s
CI / test-python-agent-core (push) Successful in 21s
CI / test-nodejs-website (push) Successful in 22s
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 34s
CI / test-go-edu-search (push) Successful in 31s
CI / test-python-klausur (push) Failing after 2m14s
CI / test-python-agent-core (push) Successful in 21s
CI / test-nodejs-website (push) Successful in 22s
Wenn column_result fehlt (z.B. OCR Overlay Pipeline), wird automatisch eine einzelne ganzseitige Pseudo-Spalte erzeugt statt einen Fehler zu werfen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1883,7 +1883,21 @@ async def detect_words(
|
||||
column_result = session.get("column_result")
|
||||
row_result = session.get("row_result")
|
||||
if not column_result or not column_result.get("columns"):
|
||||
raise HTTPException(status_code=400, detail="Column detection must be completed first")
|
||||
# No column detection — synthesize a single full-page pseudo-column.
|
||||
# This enables the overlay pipeline which skips column detection.
|
||||
img_h_tmp, img_w_tmp = dewarped_bgr.shape[:2]
|
||||
column_result = {
|
||||
"columns": [{
|
||||
"type": "column_text",
|
||||
"x": 0, "y": 0,
|
||||
"width": img_w_tmp, "height": img_h_tmp,
|
||||
"classification_confidence": 1.0,
|
||||
"classification_method": "full_page_fallback",
|
||||
}],
|
||||
"zones": [],
|
||||
"duration_seconds": 0,
|
||||
}
|
||||
logger.info("detect_words: no column_result — using full-page pseudo-column %dx%d", img_w_tmp, img_h_tmp)
|
||||
if not row_result or not row_result.get("rows"):
|
||||
raise HTTPException(status_code=400, detail="Row detection must be completed first")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user