fix: move Struktur step after OCR so word boxes are available for exclusion
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 28s
CI / test-go-edu-search (push) Successful in 30s
CI / test-python-klausur (push) Failing after 2m2s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 18s

Graphic detection needs word positions to exclude text from the ink mask.
Previously Struktur ran before OCR, causing every word to be detected as
a graphic element. Now:
- Pipeline: Struktur at index 7 (after Wörter)
- Kombi: Struktur at index 5 (after PP-OCRv5+Tesseract, before Tabelle)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-16 13:38:58 +01:00
parent 6b9b280ba3
commit 3aa4a63257
4 changed files with 32 additions and 30 deletions

View File

@@ -76,12 +76,12 @@ export default function OcrOverlayPage() {
setMode(m)
// For Kombi: if grid_editor_result exists, jump to grid editor step (6)
// If word_result exists but no grid, jump to grid editor (6)
// If structure_result exists, jump to kombi step (5)
// If structure_result exists, jump to grid editor (6)
// If word_result exists, jump to structure step (5)
const hasGrid = isKombi && data.grid_editor_result
const hasWords = isKombi && data.word_result
const hasStructure = isKombi && data.structure_result
const activeStep = hasGrid ? 6 : hasWords ? 6 : hasStructure ? 5 : 4
const hasWords = isKombi && data.word_result
const activeStep = hasGrid ? 6 : hasStructure ? 6 : hasWords ? 5 : 4
setSteps(
baseSteps.map((s, i) => ({
...s,
@@ -252,22 +252,24 @@ export default function OcrOverlayPage() {
return <StepCrop sessionId={sessionId} onNext={handleNext} />
case 4:
if (mode === 'kombi') {
return <StepStructureDetection sessionId={sessionId} onNext={handleNext} />
return (
<PaddleDirectStep
sessionId={sessionId}
onNext={handleNext}
endpoint="paddle-kombi"
title="Kombi-Modus"
description="PP-OCRv5 und Tesseract laufen parallel. Koordinaten werden gewichtet gemittelt fuer optimale Positionierung."
icon="🔀"
buttonLabel="PP-OCRv5 + Tesseract starten"
runningLabel="PP-OCRv5 + Tesseract laufen..."
engineKey="kombi"
/>
)
}
return <PaddleDirectStep sessionId={sessionId} onNext={handleNext} />
case 5:
return mode === 'kombi' ? (
<PaddleDirectStep
sessionId={sessionId}
onNext={handleNext}
endpoint="paddle-kombi"
title="Kombi-Modus"
description="PP-OCRv5 und Tesseract laufen parallel. Koordinaten werden gewichtet gemittelt fuer optimale Positionierung."
icon="🔀"
buttonLabel="PP-OCRv5 + Tesseract starten"
runningLabel="PP-OCRv5 + Tesseract laufen..."
engineKey="kombi"
/>
<StepStructureDetection sessionId={sessionId} onNext={handleNext} />
) : null
case 6:
return mode === 'kombi' ? (